Skip to content

Internal Error: immutable for sveltekit fetch #13857

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

Open
JLewinski opened this issue Jun 4, 2025 · 0 comments
Open

Internal Error: immutable for sveltekit fetch #13857

JLewinski opened this issue Jun 4, 2025 · 0 comments

Comments

@JLewinski
Copy link

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

  1. Create an api server and add public endpoints to it
  2. Setup a Sveltekit application with a vite proxy to point a specific route to the api server
  3. Add a +page.server.ts file and use event.fetch to attempt to access the api via the proxy
  4. Add a hooks.server.ts file and add a cookie to the event
  5. Run both the api and sveltekit applications
  6. 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

annoyance

Additional Information

At the very least it would be good to have a better error message, so developers understand what is going on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant