diff --git a/packages/nuxt/src/pages/module.ts b/packages/nuxt/src/pages/module.ts index 4121e0dd84..0076e4f317 100644 --- a/packages/nuxt/src/pages/module.ts +++ b/packages/nuxt/src/pages/module.ts @@ -276,15 +276,11 @@ export default defineNuxtModule({ }) // TODO: inject routes in `200.html` in next nitro upgrade (2.9.7+) via https://github.com/unjs/nitro/pull/2517 - if (!nuxt.options.dev && !nuxt.options._prepare) { + if (!nuxt.options.dev && !nuxt.options._prepare && nuxt.options.ssr) { nuxt.hook('app:templatesGenerated', (app) => { const nitro = useNitro() if (nitro.options.prerender.crawlLinks) { - for (const page of app.pages!) { - if (page.path && !page.path.includes(':')) { - nitro.options.prerender.routes.push(page.path) - } - } + nitro.options.prerender.routes.push('/') } }) }