KyleJune / deno-tailwind-ui-react-example

An example of how you can use Tailwind UI and React with Deno
20 stars 5 forks source link

Fix ssr on deploy for pages using react query #21

Closed KyleJune closed 2 years ago

KyleJune commented 2 years ago

The /posts and /post/:id pages need data from the api to render. On deploy, if /posts makes an api call to /api/posts to get the api response for server side rendering, deploy will return an error saying 508: Loop Detected (LOOP_DETECTED) Recursive requests to the same deployment cannot be processed.. It presents itself in those pages returning internal server error because that error currently isn't handled and the response body is not valid JSON like it expects from the api.