question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`getSession()` does not get called on page load. should warn user

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:17 (12 by maintainers)

github_iconTop GitHub Comments

3reactions
eriknykcommented, Feb 5, 2022

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. 😦

1reaction
tcc-sejohnsoncommented, Aug 4, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - Warn the user before session timeout - Stack Overflow
var cookieName = 'sessionMsg'; var message = 'Your session is going to be end ... You can use like follows: I am using...
Read more >
Hibernate Session get() vs load() difference with examples
get() loads the data as soon as it's called whereas load() returns a proxy object and loads data only when it's actually required,...
Read more >
Store user information in the session - ServiceNow Community
Hello, We are trying to store additional user data in the session object upon user login but to no success so far. We've...
Read more >
"Response is committed" error during page load in AEM6.x
IllegalStateException: Response is committed” error coming from org.eclipse.jetty.server.Request.getSession while browsing to static content.
Read more >
next-session - npm
store is undefined ), MemoryStore , DOES NOT work in production or serverless environment. You must use a Session Store. // ./lib/get-session.js ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found