Dynamic environment variables undefined during SSR on Windows (*not* fixed by #5955)
See original GitHub issueDescribe the bug
I already mentioned it in https://github.com/sveltejs/kit/issues/5941#issuecomment-1221102524 but it might get lost.
On Windows, the env
-export of $env/dynamic/private and $env/dynamic/public is always an empty object.
This issue was present on Linux, too, but #5955 apparently fixed it there (available since next.418). It did not, however, fix it for Windows.
Reproduction
Repro https://github.com/validData/kit-env-issues The repo should be rather self explanatory - the page uses private and public, dynamic and static environment variables. Static environment variables work fine both on Windows and Linux, dynamic variables only work fully on Linux. On Windows, all server side dynamic variables are missing. On the client side, they work fine (though not shown here - hydration is deactivated)
Running on WSL:
Running on Windows:
Logs
No response
System Info
System:
OS: Windows 10 10.0.19043
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 10.60 GB / 31.81 GB
Binaries:
Node: 16.15.1 - c:\tools\node\node.EXE
Yarn: 1.22.19 - c:\tools\node\yarn.CMD
npm: 8.13.2 - c:\tools\node\npm.CMD
Browsers:
Edge: Spartan (44.19041.1266.0), Chromium (104.0.1293.63)
Internet Explorer: 11.0.19041.1566
npmPackages:
@sveltejs/adapter-auto: next => 1.0.0-next.65
@sveltejs/kit: next => 1.0.0-next.428
svelte: ^3.44.0 => 3.49.0
vite: ^3.0.4 => 3.0.9
Severity
blocking an upgrade
Additional Information
No response
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
I have the same problem. Windows, and the $env/dynamic/private is always empty. I’m on : @sveltejs/kit@1.0.0-next.431
Update: Works for me too now on : @sveltejs/kit@1.0.0-next.459
Thanks, I’ve confirmed that it’s fixed for me as well on @sveltejs/kit@1.0.0-next.456.