solid-start
solid-start copied to clipboard
[Bug?]: internal $fetch (Nitro) looping endlessly in build pre-rendering since 1.0.7
Duplicates
- [X] I have searched the existing issues
Latest version
- [X] I have tested the latest version
Current behavior 😯
Since 1.0.7, in a setup where we have internal API routes, and we're trying to fetch them in the nitro build through the $fetch helper, the page is rendering endlessly in a stuck loop.
https://nitro.unjs.io/guide/fetch#in-server-fetch.
Downgrading @solidjs/start to 1.0.6 fixes the issue.
Expected behavior 🤔
Same behaviour as 1.0.6, which doesn't break internal api calls through the $fetch event helper.
Steps to reproduce 🕹
Steps:
- Go to https://stackblitz.com/~/github.com/Jylth/solid_issue_prerender_fetch_internal_api?file=src/routes/index.tsx
- Run a build with
pnpm build
- Observe that the page prerendering of the index is looping endlessly
To fix the issue, simply downgrade the @solidjs/start package to 1.0.6.
Context 🔦
This breaks an app which was working well since a couple of months on v1.0.6. Upgrading to a more recent version of the package breaks it completely.
The behaviour on a more complex app is a bit different. Instead of looping endlessly, the nitro server simply stops after trying prerendering the route and the build fails. Logging the requests in a middleware shows that the internal API calls are received, but the path of the request is missing, they all go to the root /
.
Might be the same issue as #1640