Using Nuxt's clearNuxtState method returns an error:
storage.mjs:124 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'loggedIn')
at storage.mjs:124:40
at callWithErrorHandling (runtime-core.esm-bundler.js:158:32)
at getter (runtime-core.esm-bundler.js:1769:22)
at ReactiveEffect.getter [as fn] (runtime-core.esm-bundler.js:1792:29)
at ReactiveEffect.run (reactivity.esm-bundler.js:178:19)
at job (runtime-core.esm-bundler.js:1826:31)
at flushPreFlushCbs (runtime-core.esm-bundler.js:309:7)
at updateComponentPreRender (runtime-core.esm-bundler.js:5916:5)
at ReactiveEffect.componentUpdateFn [as fn] (runtime-core.esm-bundler.js:5834:11)
at ReactiveEffect.run (reactivity.esm-bundler.js:178:19)
Additional context
Part of my logout sequence, I call useAuth().reset(), then clearNuxtData() & clearNuxtState(). clearNuxtState is what causes this issue here:
Environment
Build Modules: -
Nuxt Config
-
Reproduction
-
Describe the bug
Using Nuxt's
clearNuxtState
method returns an error:Additional context
Part of my logout sequence, I call
useAuth().reset()
, thenclearNuxtData()
&clearNuxtState()
.clearNuxtState
is what causes this issue here:https://github.com/nuxt-alt/auth/blob/946768b6ed825fda2962b2093037824234b98b6f/src/runtime/core/storage.ts#L161
Logs
No response