cloudflare will block request from client?

I deployed a nextjs app on cloudflare, these are a server component and a api endpoint.
And the server component will request the api endpoint with
fetch(${getBaseUrl(req as NextRequest)}/api/search, {
    method: "POST",
  }).then(r=>r.json())


npm run dev
is ok, everything is fine. but after deploying on cloudflare, the
fetch
gives SyntaxError: Unexpected token 'e', "error code: 522" is not valid JSON .

obviously, the response is not json. but why? it makes no sense that cloudflare blocked the request?
Was this page helpful?