NuxtN
Nuxtβ€’2y ago
markusgx

Pre-Render not pre rendering

Hi πŸ™‹
I stumpled across a weird problem. My pre-rendered Routes are not working anymore. Havent found anything in the release notes - but the following code worked in previous versions / other projects.

I am pre-rendering 2 routes on build, but the .html file generated are kind of empty:
<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=/_forms/call-back/"></head></html>


I am using the 'nitro:config' hook to dynamically add routes to pre-render, which seems to work.
β„Ή Prerendering 2 routes                                                         nitro 8:21:51 AM
  β”œβ”€ /_forms/schreib-uns-kontaktformular (73ms)                                                                                                                                                                                                                 nitro 8:21:51 AM
  β”œβ”€ /_forms/call-back (75ms)     


//nuxt.config.ts
import routePrerender from './routePrerender'
hooks: {
  'nitro:config': routePrerender
}

//routePrerender.ts
//Here i am pushing route rules to the config: 

config.routeRules = {
  ...config.routeRules,
  [`/${story.full_slug}`]: {
    prerender: true,
    experimentalNoScripts: true,
  },
}


Any ideas why the routes are not pre-renderd? When running on DEV the routes work in SSR.
Was this page helpful?