Description
Describe the bug
Using the sveltekit fetch in a +page.server.ts load function will cause an Internal Error whenever a cookie is set in the hooks.server.ts handle function.
Reproduction
- Create an api server and add public endpoints to it
- Setup a Sveltekit application with a vite proxy to point a specific route to the api server
- Add a +page.server.ts file and use event.fetch to attempt to access the api via the proxy
- Add a hooks.server.ts file and add a cookie to the event
- Run both the api and sveltekit applications
- Notice when the page is hit it will return an Internal Error
Here is a working reproduction: https://github.com/JLewinski/Reproduction/tree/master
Logs
System Info
System:
OS: Windows 11 10.0.26100
CPU: (16) x64 AMD Ryzen 7 PRO 7840U w/ Radeon 780M Graphics
Memory: 33.68 GB / 59.67 GB
Binaries:
Node: 18.20.8 - C:\nvm4w\nodejs\node.EXE
npm: 10.8.2 - C:\nvm4w\nodejs\npm.CMD
Browsers:
Edge: Chromium (133.0.3065.92)
Severity
Serious, but I can work around it
Additional Information
At the very least it would be good to have a better error message, so developers understand what is going on.
Metadata
Metadata
Assignees
Labels
No labels