mazipan / nuxt-storage

🛢 Utilities for easy read and write browser's storage in Nuxt.js project
MIT License
126 stars 7 forks source link

500 __vite_ssr_import_1__.default.localStorage.getItem is not a function #234

Open javokhirbekkhaydarov opened 1 year ago

javokhirbekkhaydarov commented 1 year ago

hi i wrote this coode import nuxtStorage from "nuxt-storage";

export const state = () => ({ token: nuxtStorage.localStorage.getItem("_auth_token"),

vuex nuxt 3 but show this error tResponse.js?t=1682618774204:32 Uncaught TypeError: nuxtStorage.localStorage.getItem is not a function

how to fix

yunglocokid commented 3 months ago

same

__vite_ssr_import_2__.default.localStorage.getItem is not a function

at EffectScope.run (./node_modules/@vue/reactivity/dist/reactivity.cjs.js:47:16) at ./node_modules/pinia/dist/pinia.mjs:1450:88 at EffectScope.run (./node_modules/@vue/reactivity/dist/reactivity.cjs.js:47:16) at ./node_modules/pinia/dist/pinia.mjs:1450:54 at runWithContext (./node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:3955:18) at createSetupStore (./node_modules/pinia/dist/pinia.mjs:1450:24) at Module.useStore (./node_modules/pinia/dist/pinia.mjs:1717:17) at setup (./layouts/default.js:22:45) at _sfc_main.setup (./layouts/default.js:53:23)