Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

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

Open
javokhirbekkhaydarov opened this issue Apr 27, 2023 · 1 comment

Comments

@javokhirbekkhaydarov
Copy link

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
Copy link

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)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants