-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
navigateTo
has no effect when a plugin is declared
#14771
Comments
I was hoping |
Hi @Baloche sorry for answering late. I have made updated working example for you: https://stackblitz.com/edit/github-yjetdx?file=composables%2Findex.ts |
Thanks for the answer @pi0 :) export default defineNuxtPlugin(() => {
return {
provide: {
hello: (msg: string) => `Hello ${msg}!`,
},
};
}); |
Right! Try this updated sandbox: https://stackblitz.com/edit/github-yjetdx?file=composables%2Findex.ts (#14805) |
Thank you! I was trying the same lead ! It works! |
Happy hearing this! Let's track improvements from linked issues. |
@pi0, I've encountered an issue that I could use your help with. Everything seems to be perfect, but I'm running into an error on the pages/index.vue page when I try to reference a user attribute. I thought the redirection was supposed to take place before the template generation, right? Additionally, I'm curious if callWithNuxt functions the same as nuxtApp.runWithContext. Your insights would be greatly appreciated! Thank you. https://codesandbox.io/p/sandbox/nuxt-3-navigateto-with-usefetch-forked-r4rz6m |
Environment
Darwin
v16.15.1
3.0.0-rc.8
npm@8.11.0
vite
runtimeConfig
,css
,vite
,typescript
,modules
,unocss
@unocss/nuxt@^0.44.7
,@vueuse/nuxt@9.1.1
-
Reproduction
https://codesandbox.io/s/nuxt-3-navigateto-with-usefetch-15ihel
Describe the bug
To intercept every 401 error I receive from my API, I created a wrapper method of
useFetch
:But somehow, it only works if I don't have any plugins declared.
If you comment every line of this file, the redirection works well, but as long as the
defineNuxtPlugin
function is called, the redirection does not work. Why ?Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: