adapter-node responds with pre-rendered assets for non-GET requests #3294
Labels
p1-important
SvelteKit cannot be used by a large number of people, basic functionality is missing, etc.
pkg:adapter-node
Milestone
Describe the bug
Given the following scenario:
@sveltejs/adapter-node
(ver^1.0.0-next.61
)export const prerender = true;
on a pagePOST
endpoint handler on the same path as the pre-rendered pageThe artifact produced by the node adapter will always respond with the prerendered page to any requests to the shared path, even if the request uses method
POST
.Reproduction
npm install
npm run dev
/login
page with javascript enabled, and usefoo@example.com
andbar
.application/json
-> The request was served by the endpoint handler.npm run build
node build
/login
page with javascript enabledfoo@example.com
andbar
Logs
No response
System Info
Severity
blocking an upgrade
Additional Information
The obvious workaround is to disable pre-rendering, but this meets the current suggested guidelines for when to enable pre-rendering.
When
GET
-ing the page, every user should receive the same response. It's only once aPOST
request is made with fallthrough logic that the response should be varied.The text was updated successfully, but these errors were encountered: