We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
pnpm dlx nuxi@latest init <project-name>
pages/[..slugs].vue
<template><div>Nuxt App</div></template>
pnpm run generate
location / { try_files $uri $uri/ @router; index index.html index.htm; } location @router { rewrite ^.*$ /index.html last; }
/foo
/
when you visit /foo, nginx will return the index.html, but the url will back to the / after nuxt app ready.
I found that initialURL will be override by nuxtApp.payload.path.
initialURL
nuxtApp.payload.path
nuxt/packages/nuxt/src/pages/runtime/plugins/router.ts
Line 72 in fa79b86
so i add useNuxtApp().payload.path = '' to app.vue, it works.
useNuxtApp().payload.path = ''
app.vue
Is there any other better way to solve this problem?
No response
The text was updated successfully, but these errors were encountered:
Bump, encountering this as an major issue in our upcoming internal app, there are dynamic routes that are sent by email and could not be accessed.
Sorry, something went wrong.
The best solution here is to have nginx serve up 200.html for unknown routes that have not been prerendered. (It's intended for that purpose.)
200.html
No branches or pull requests
Environment
Reproduction
pnpm dlx nuxi@latest init <project-name>
create a projectpages/[..slugs].vue
pnpm run generate
command and move to dist folder to nginx root folder/foo
, browser will back to/
path when nuxt app is readyDescribe the bug
when you visit
/foo
, nginx will return the index.html, but the url will back to the/
after nuxt app ready.I found that
initialURL
will be override bynuxtApp.payload.path
.nuxt/packages/nuxt/src/pages/runtime/plugins/router.ts
Line 72 in fa79b86
so i add
useNuxtApp().payload.path = ''
toapp.vue
, it works.Is there any other better way to solve this problem?
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: