Skip to content

Instantly share code, notes, and snippets.

View hoishing's full-sized avatar
🚀

Kelvin Ng hoishing

🚀
View GitHub Profile
@smc181002
smc181002 / using_localStoage_with_sveltekit_and_svelte_store.md
Last active November 22, 2021 17:15
Using localStoage with sveltekit and svelte store

About

I have been building sveltekit and I enocuntered this where sveltekit wont work if you use localstorage API directly because our sveltekit will be running in both client and server and server node.js will pose an error for undefined localStoage API

I have looked for this in stackoverflow and I was not able to find the exact answer anywhere. But then I encountered a stackoverflow question after a lot of searching and here is the solution