-
-
Notifications
You must be signed in to change notification settings - Fork 116
Sveltekit Reference Error window is not defined #269
Comments
Oops! I added some checks for local storage, looks like I missed the case when running on the server (the check involves accessing the |
Not sure if you can share your code but I created a quick test SvelteKit project and as long as I create the picker in Can you share some code showing how you're using the picker in a SvelteKit app so I can try to recreate it and add the proper check? |
In dev mode everything is fine. |
Ah, I only tried it in development mode! Sorry, I am not super familiar with SvelteKit. I think I've got it, after I run build and preview the picker works now without error. Should have a new release ready shortly. |
Ok! Just published 5.8.1. Let me know if that solves the issue! Thanks for providing that test case. |
Everything is working. Thank you for your quick fix. |
Awesome, again sorry about that. Thanks for using the library! |
I'm using SvelteKit and since I moved to version 5.8.0 from 5.7.5 the site throws this error when I hard refresh the site.
ReferenceError: window is not defined File "/Projects/sveltekit-sk/node_modules/picmo/dist/index.js", line 287, in <anonymous> '{snip} le.warn("[picmo] sessionStorage not available, falling back to simple in-memory storage"), Object.defineProperty(window, "sessionStorage", { File "node:internal/modules/esm/module_job", line 194, in ModuleJob.run
It is working perfectly fine with version 5.7.5 but with the latest or with 5.7.6 I get this.
The text was updated successfully, but these errors were encountered: