question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

nuxt preview renders existing routes as 404

See original GitHub issue

Environment

  • 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

  1. Clone the repository
  2. Run yarn to install dependencies
  3. Run yarn generate to generate the page
  4. 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:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
P4sca1commented, Sep 28, 2022

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?

0reactions
danielroecommented, Sep 28, 2022
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found