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.

[SSG] No `200.html` is being rendered

See original GitHub issue

Environment

RootDir: /sandbox Nuxt project info:


  • Operating System: Linux
  • Node Version: v14.18.1
  • Nuxt Version: 3.0.0-rc.3
  • Package Manager: yarn@1.22.17
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

  1. Open the sandbox (and possibly clone locally)
  2. Run yarn generate
  3. See that a fallback file is missing

Describe the bug

When using target: 'static', I expected that a 200.html (or differently named) fallback file is being rendered. Unfortunately, no such file is being generated at the moment.

Even with generate.fallback set to true or 200.html, no file is present after the generation process.

Additional context

_Originally posted by @edwh in https://github.com/nuxt/framework/discussions/4967_

Logs

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
manniLcommented, Aug 28, 2022

I currently use a workaround, injecting the route /404.html to the routes to generate.

But this will render the 404.html with the error layout “as is” and won’t allow SPA-like fallback. Which means solving “only” half of the issue.

1reaction
hacknugcommented, Jun 27, 2022

There’s also an issue with the types for the fallback property.

According to the inline documentation the value should be boolean | string but it’s actually just string. You can reproduce this by changing the value on the sandbox OP provided.

I looked for the types definition in the repo but I couldn’t find it. If anyone knows where they are, I’ll gladly make the change myself (if this is something that’s manually generated).

Captura de Pantalla 2022-06-27 a las 20 46 37
Read more comments on GitHub >

github_iconTop Results From Across the Web

HTML 5.1: 10. Rendering - W3C
An element is being rendered if it has any associated CSS layout boxes, SVG layout boxes, or some equivalent in other styling languages....
Read more >
When to Choose SSR or SSG: A Guide to Page Rendering
In SSG, static HTML is rendered at build time from templates and content provided by the developer, then delivered upon request by the...
Read more >
Next.js: Server-side Rendering vs. Static Generation - Vercel
With Static Generation (SSG), Next.js pre-renders the page into HTML on the server ahead of each request, such as at build time.
Read more >
Server-Side Rendering - Vite
Pre-Rendering / SSG​​ If the routes and the data needed for certain routes are known ahead of time, we can pre-render these routes...
Read more >
Understanding static HTML export in Next.js - LogRocket Blog
js is renowned in the React world for being a great tool for dynamic applications because of its range of features and rendering...
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