NuxtN
Nuxt16mo ago
cmcnicholas

Prerender Ignore Wildcard Path

I have a static nuxt site that uses environment variables that are tokenised into the application during build. On deployment we replace these tokens resulting in no rebuild on deploy.

The tokens look like: __VITE_SOMETHING__, they are used for some links on the site. During static build nuxt will traverse these and I get:

Errors prerendering:
 [nitro]   ├─ /__VITE_SOMETHING__ (159ms)
   │ ├── Error: [404] Page not found: /__VITE_ID_REDIRECT_URL__


I have tried:

  1. Marking NuxtLink's as external
  2. Adding to my routeRules the following:
  routeRules: {
    '/__VITE**': { prerender: false },
    '/**': { prerender: true },
  },


But neither seem to work.

Is there a way to tell nuxt to ignore a wildcarded path during static compile?
Was this page helpful?