Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

localStorage is not a function when using sveltekit #17

Open
isaacfink opened this issue Mar 10, 2022 · 2 comments
Open

localStorage is not a function when using sveltekit #17

isaacfink opened this issue Mar 10, 2022 · 2 comments
Labels
bug Something isn't working sveltekit version 1.x

Comments

@isaacfink
Copy link

isaacfink commented Mar 10, 2022

I get the following error when using sveltekit

__vite_ssr_import_0__.localStorage is not a function

this is my store code

export const cart = persist(writable({packages:[]}), localStorage(), 'cart')
@MacFJA MacFJA added bug Something isn't working sveltekit labels Mar 12, 2022
@michaelcuneo
Copy link

localStorage() has been changed to createLocalStorage()

@MacFJA
Copy link
Owner

MacFJA commented Aug 27, 2022

I rename the function that give the storage between version 1.3.0 and 2.0.0.
They were given the false impression that the same instance of the storage was given every time.
With the new name it's clear that the function create a new storage instance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sveltekit version 1.x
Projects
None yet
Development

No branches or pull requests

3 participants