Skip to content

Calling clearNuxtState throws error #87

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

Closed
ttonyh opened this issue Dec 6, 2023 · 0 comments
Closed

Calling clearNuxtState throws error #87

ttonyh opened this issue Dec 6, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@ttonyh
Copy link

ttonyh commented Dec 6, 2023

Environment



Nuxt Config

Reproduction

Describe the bug

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:

image

watch(() => this.#initStore.value[watchKey], (modified, old) => {

  • I am NOT using Pinia.

Logs

No response

@ttonyh ttonyh changed the title Getting useRoute is not defined Calling clearNuxtState throws error Dec 6, 2023
@Denoder Denoder added bug Something isn't working and removed pending triage labels Dec 7, 2023
@Denoder Denoder mentioned this issue Dec 7, 2023
@Denoder Denoder closed this as completed Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants