nuxt preview renders existing routes as 404
See original GitHub issueEnvironment
- Operating System:
Darwin
- Node Version:
v16.13.0
- Nuxt Version:
3.0.0-rc.11
- Nitro Version:
0.5.4
- Package Manager:
yarn@3.2.3
- Builder:
vite
- User Config:
-
- Runtime Modules:
-
- Build Modules:
-
Reproduction
https://github.com/P4sca1/th-koeln-was/tree/9493a77f559177eddd7fb8d907a0effeb55c51df
Describe the bug
- Clone the repository
- Run
yarn
to install dependencies - Run
yarn generate
to generate the page - Run
yarn preview
to serve the generated page
Visit http://localhost:3000. The home page shows without any issues (SSR). Notice that client-side navigation also works without any issues.
Now navigate to any page except the home page using the sidebar and reload the page. Notice that all the other pages do not work when they are rendered on the server. They will show the home page for a short amount of time and render the DocumentDrivenNotFound
component afterwards.
Additional context
Everything works fine in development mode.
Logs
No response
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Preview Mode - Nuxt
With Nuxt and full static you can now use live preview out of the box which will call your API or your CMS...
Read more >nuxt 404 page not rendering on live version, but works in ...
I'm using nuxt generate option, and have a custom 404 page created with error.vue in layouts. In my nuxt.config.js I have the following:...
Read more >Creating 404 pages with Nuxt and Netlify - Wes Wilson
A walk through on setting up my 404 page. ... By default, Nuxt displays this component anytime a non server-side rendering error occurs....
Read more >How to handle content previews from Sanity in Nuxt
There's a SPA fallback that we can activate by setting generate.fallback to true in nuxt.config.js . Now Nuxt won't default to a 404...
Read more >Going Full Static - NuxtJS
nuxt generate is mostly pre-rendering, when you navigate client-side, ... rendering on 404, errors and redirects (see SPA fallback); $route.query will ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The vercel build at https://th-koeln-was.vercel.app/fuer-waehlende works without a problem. Maybe this is related to web server configuration and an issue with the
nuxt preview
command?In that case we can track in https://github.com/nuxt/framework/issues/6226 and https://github.com/vercel/serve/issues/722.