-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Hybrid rendering doesn't generate spa fallback html #23055
Comments
Start a new pull request in StackBlitz Codeflow. |
I was having a similar problem but I think I found the solution in the docs. The spa fallback page is called I turned prerendering off by default via routeRules but this meant that 200.html wasn't being generated. I solved this by adding it to my route rules: export default defineNuxtConfig({
routeRules: {
'/200.html': { prerender: true },
'/**': { prerender: false },
},
}); Then I configured my back-end to use 200.html as the fallback page and everything worked. |
@jf908 It works! However, I didn't turn prerendering off by default, but I still need to declare
Without your solution, I worked around it previously by using With your solution, I can get back to the normal However, I think this should be explicitly documented in docs. @danielroe |
Yes, it would make sense to make sure we explain about |
Depending on the preset (I am using What works for me is export default defineNuxtConfig({
nitro: {
prerender: {
routes: ['/200/index.html'],
},
routeRules: {
'/200/index.html': { ssr: false },
}
}
}); |
Environment
Darwin
v16.20.1
3.6.5
2.5.2
pnpm@8.7.4
vite
nitro
,app
,ui
,devtools
,typescript
,vue
,modules
,content
,colorMode
,vite
@nuxt/content@2.7.2
,@nuxthq/ui@2.7.0-28233674.a2970cb
-
Reproduction
https://stackblitz.com/edit/github-h3ry36?file=nuxt.config.ts
Describe the bug
Got this config:
If this isn't a bug, how to generate the fallback htmls like
nuxt generate
?Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: