-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GET request with query params was prerendered #4942
Comments
The endpoint is in server/entries, but all requests (from load and from the client) go to the prerendered. |
When you prerender, you're writing files to the filesystem so that a simple webserver can serve them. Query parameters can't exist on the filesystem (both in the literal sense that If you try to access query parameters in a page during prerendering, SvelteKit will throw an error for those reasons. We need to apply the same logic to endpoints.
Prerendering a page implies prerendering the things the page depends on, otherwise client-side navigation will fail (when you're serving a site from GitHub Pages, navigating from |
The response of this endpoint for the page is saved in ./prerendered/ and in prerendered html (2 times), and it itself is in ./server/entries/endpoints/. And a prerendered response is returned to all requests to the endpoint, requests do not reach the endpoint itself. |
Describe the bug
The response depends on query params, but it was executed once and saved, and then all queries return the result of the first execution.
And why do the endpoints prerendare at all? Isn't this still being worked on?
npm run build -> ./build/prerendered/api/post/get
Reproduction
https://stackblitz.com/edit/sveltejs-kit-template-default-k2ducm
System Info
Severity
blocking all usage of SvelteKit
Additional Information
No response
The text was updated successfully, but these errors were encountered: