From 44cada95a6c42bc9cc36da847b41009e95f2ebaa Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sun, 16 Jun 2024 00:00:20 +0100 Subject: [PATCH] fix(nuxt): only inject root path in prerender --- packages/nuxt/src/pages/module.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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('/') } }) }