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
When using adapater-static and ssr: false I'm getting the following error when running npm run build.
Run npm run preview to preview your production build locally.
> Using @sveltejs/adapter-static
> localStorage is not defined
ReferenceError: localStorage is not defined
at file:///www/wwwroot/domain-name.here/.svelte-kit/output/server/app.js:1751:45
This to me doesn't make sense as adapter-static from my knowledge isn't meant to be a node server. So it doesn't matter that localStorage is not defined server side as it's never intended to run server side. Refusing to build because of this just adds so much unnecessary complexity to a project as we have to build it as through it's running a NodeJS server with the knowledge that it will never.
Reproduction
Create a project that uses localStorage in ssr: false mode. You will not see any errors it knows to run without server side rendering.
Use the adapter-static to make it a static website.
You'll get the error that you can not use localStorage.
Describe the bug
When using
adapater-static
andssr: false
I'm getting the following error when runningnpm run build
.This to me doesn't make sense as
adapter-static
from my knowledge isn't meant to be a node server. So it doesn't matter that localStorage is not defined server side as it's never intended to run server side. Refusing to build because of this just adds so much unnecessary complexity to a project as we have to build it as through it's running a NodeJS server with the knowledge that it will never.Reproduction
ssr: false
mode. You will not see any errors it knows to run without server side rendering.adapter-static
to make it a static website.You'll get the error that you can not use localStorage.
Logs
No response
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: