-
-
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
redirect via navigateTo() not working with nuxt generate #14412
Comments
What do you expect to happen? Should the page not be generated? |
I would expect it to behave exactly like |
A server-side redirection can't be rendered as an HTML page as such. But what we could do is return a minimal blank white HTML page that immediate redirects to the target location on client-side, which seems reasonable and better than at present. |
ah, of course. i understand. many thanks for the clarification and the super fast reaction! imho a workable solution would also be: <script setup lang="ts">
onMounted(() => {
navigateTo('/target', { replace: true })
})
</script> |
Should already be implemented in h3 and you'll get the benefit in next h3 release 😊 |
Please use |
Environment
Linux
v16.14.2
3.0.0-rc.6
npm@7.17.0
vite
-
-
-
Reproduction
https://stackblitz.com/edit/nuxt-starter-zaokyb?file=pages/index.vue
Describe the bug
having a page redirect to another page via the
navigateTo
helper does not work withnuxt generate
.e.g.
gets rendered as a white page with the text
Redirecting to /target
.see attached stackblitz-project for an example.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: