kit: `getSession()` does not get called on page load. should warn user
Describe the bug
Unfortunately, I haven’t been able to get our sveltekit app to work in production past kt@next.206 and adapter-node@next.56.
Since the ssr was always somewhat flunky with our - aside from the login page- completely private app we previously disabled it via the config and on all update attempts in the handle hook.
Now, the issue is always the same, everything runs fine locally, until it gets deployed, where you can’t get past the login screen anymore, since the session never gets populated. I recently found out that the issue seems to lie somewhere within adapter-node, since running dev
and preview
works flawlessly, but running the build output directly via node _build
presents the same issue our staging environment showed locally.
Any help/pointers would be appreciated, ready to replace our auth code if necessary/it’s just us working against sveltekit.
If you have any further questions, feel free to ask !
Reproduction
https://github.com/luhagel/sveltekit-node-session-repro
Logs
No response
System Info
System:
OS: macOS 11.6
CPU: (12) x64 AMD Ryzen 5 3600X 6-Core Processor
Memory: 9.02 GB / 32.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 17.4.0 - /usr/local/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 8.3.1 - /usr/local/bin/npm
Browsers:
Chrome: 98.0.4758.80
Firefox: 96.0.2
Safari: 15.0
npmPackages:
@sveltejs/adapter-auto: next => 1.0.0-next.17
@sveltejs/adapter-node: ^1.0.0-next.67 => 1.0.0-next.67
@sveltejs/kit: next => 1.0.0-next.260
svelte: ^3.44.0 => 3.46.4
Severity
blocking an upgrade
Additional Information
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 5
- Comments: 17 (12 by maintainers)
same here, sadly I cannot simply remove
{ssr: false}
because with ssr enabled mane dependencies are broken, and I cannot modify them since they are third-party libs that only works on client side. 😦Oh, pff, I’m stupid – this is the session store. Yeah, I would open a new issue and reference this one. Be sure to include a small repro with StackBlitz or a GitHub repo.
@PH4NTOMiki Thanks for looking into this ! Gonna give it a try with the full scale non-repro project and keep you posted 👍