-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Headers are not set when ssr = false #8428
Comments
What do you mean by the step "get headers ( |
@dummdidumm sorry about the confusion. The I've double-checked and confirmed the issue. Here is the screenshot of headers when the app running in dev mode ( And here is a screenshot of the app that runs in production mode ( Please let me know if you get different results. The problem I am trying to solve in my app is to set the |
ohhh.... this must be because of #8131. Two options:
#8131 is a valuable optimisation so it would be a shame to lose it, but I wonder how we can make this behaviour clearer. |
Is there the possibility of a third option where we somehow check if |
No, that seems like a pretty good solution as long as it's documented (you could always opt back in with |
There's a feature request for saving the headers and serving them here: #9408 |
Describe the bug
In production build, the headers are not set if
ssr = false
in+layout.server.ts
Reproduction
Create SvelteKit skeleton project
Set headers in
hooks.server.ts
+layout.server.ts
:pnpm build
pnpm preview
https -h http://127.0.0.1:4173/
)See reproduction repo: https://github.com/ebeloded/kit-headers-bug
Logs
System Info
Additional Information
pnpm dev
adapter-auto
, but behavior is the same withadapter-node
The text was updated successfully, but these errors were encountered: