You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that the Nuxt Plugin has no access to the Vue instance, so when I use a native composable to access to the router or the route, it throws an error saying that the Vue instance is not defined. It also cause error with other composables that use the native composables, such as navigateTo().
Additional context
I was upgrading the Nuxt Bridge from the version 3.0.0-27639120.e7a7f9b and using the new middleware router for an auth plugin when the console throw an error when I use the useRouter() and useRoute() from the #app namespace, so reading the changelog I discover the #533 pull request, so I update my imports according to use the native vue-router/composables namespace, causing the error in the console.
Logs
[nuxt] [request error] [vue-router]: Missing current instance. useRoute() must be called inside <script setup> or setup().
at throwNoCurrentInstance (./.nuxt/dist/server/server.js:7304:11)
at useRoute (./.nuxt/dist/server/server.js:7318:5)
at eval (./.nuxt/dist/server/server.js:20653:88)
at callWithNuxt (./.nuxt/dist/server/server.js:2507:20)
at eval (./.nuxt/dist/server/server.js:2517:26)
at createApp (./.nuxt/dist/server/server.js:1047:85)
at async module.exports../.nuxt/server.js.__webpack_exports__.default (./.nuxt/dist/server/server.js:1602:7)
at async Object.renderToString (./node_modules/vue-bundle-renderer/dist/runtime.mjs:198:19)
at async eval (./.nuxt/dev/index.mjs:542:21)
at async eval (./.nuxt/dev/index.mjs:118:22)
The text was updated successfully, but these errors were encountered:
Environment
Linux
v16.17.0
2.16.0-27720022.54e852f
0.5.4
pnpm@7.12.2
webpack
target
,ssr
,head
,components
,bridge
,buildModules
,modules
,plugins
,vuetify
,hydra
,publicRuntimeConfig
,privateRuntimeConfig
,build
,router
,serverHandlers
,devServerHandlers
@instacarmx/nuxt-hydra@0.2.8
()
,@nuxtjs/vuetify@1.12.3
,@nuxt/bridge@3.0.0-27732833.edd9c5d
Reproduction
https://stackblitz.com/edit/github-zys9qe
Describe the bug
It seems that the Nuxt Plugin has no access to the Vue instance, so when I use a native composable to access to the router or the route, it throws an error saying that the Vue instance is not defined. It also cause error with other composables that use the native composables, such as
navigateTo()
.Additional context
I was upgrading the Nuxt Bridge from the version 3.0.0-27639120.e7a7f9b and using the new middleware router for an auth plugin when the console throw an error when I use the
useRouter()
anduseRoute()
from the#app
namespace, so reading the changelog I discover the #533 pull request, so I update my imports according to use the nativevue-router/composables
namespace, causing the error in the console.Logs
The text was updated successfully, but these errors were encountered: