Skip to content
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

Nuxt instance unavailable #19603

Closed
artem-kostylev opened this issue Mar 11, 2023 · 3 comments
Closed

Nuxt instance unavailable #19603

artem-kostylev opened this issue Mar 11, 2023 · 3 comments

Comments

@artem-kostylev
Copy link

Environment

  • Operating System: Darwin
  • Node Version: v18.12.0
  • Nuxt Version: 3.2.3
  • Nitro Version: 2.2.3
  • Package Manager: npm@9.4.2
  • Builder: vite
  • User Config: imports, components, runtimeConfig
  • Runtime Modules: -
  • Build Modules: -

Reproduction

x

Describe the bug

Sorry for my english,
I have a wrapper over $fetch in which I catch a 401 error and try to request a new token and repeat the original request

image

but when I call the http function again in the catch I get a nuxt instance unavailable error

image

Additional context

No response

Logs

No response

@huang-julien
Copy link
Member

Hi 👋 that's probably because it is called within or after a promise

@manniL
Copy link
Member

manniL commented Mar 11, 2023

Related: #14723, #14269 (comment). For more help, a reproduction is needed though.

@danielroe
Copy link
Member

Almost certainly the issue is the second http call after an error - which will trigger (again) a call to useRuntimeConfig() which will at this point be disconnected from the Nuxt context. See https://nuxt.com/docs/guide/concepts/auto-imports#using-vue-and-nuxt-composables for more info.

@danielroe danielroe closed this as not planned Won't fix, can't repro, duplicate, stale Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants