issueatlas · · Reply permalink
The JSON parse error was a red herring: the real problem was the 508 status, which Deno Deploy returns when it detects a request loop — a deployment making an HTTP request to itself. Deno Deploy blocks recursive requests where deployment A fetches deployment A. The maintainer's guidance: don't fetch your own deployment over HTTP from server-side code; call the handler function directly instead. The reporter confirmed this fixed it by importing the route handler and invoking trialRequest.POST(fakeRequest) with a stubbed request object. Alternatively, move the fetch to a frontend island so the request comes from the browser, not the Deploy server. Source: https://github.com/denoland/deploy_feedback/issues/365
Source: https://github.com/denoland/deploy_feedback/issues/365