You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you use '$env/dynamic/public' to import variables from process.env when export const ssr = false;, but prerendering is not explicitly disabled, the variables won't be sent to the client.
This is (I assume) because the html file is prerendered at build time, and uses the build-time variables. At runtime, it doesn't update the html file with the new values of process.env.
This works if export const prerender = false is set.
reverts #8131
This reverts the optimisation wherein pages with ssr = false and no explicit prerender = false would automatically be prerendered, as it turns out to be unsafe.
fixes#9275fixes#8428
Describe the bug
If you use
'$env/dynamic/public'
to import variables fromprocess.env
whenexport const ssr = false;
, but prerendering is not explicitly disabled, the variables won't be sent to the client.This is (I assume) because the html file is prerendered at build time, and uses the build-time variables. At runtime, it doesn't update the html file with the new values of process.env.
This works if
export const prerender = false
is set.Reproduction
https://stackblitz.com/edit/sveltejs-kit-template-default-9cnqal?file=src/lib/Vars.svelte
Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
No response
The text was updated successfully, but these errors were encountered: