nuxt-ui-pro / saas

A SaaS template made with Nuxt UI Pro.

Home Page:https://saas-template.nuxt.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

404 Status while accessing docs page in static website

ilshm opened this issue · comments

commented

After static site rendering (nuxt generate) I get 404 when try to open Docs

tried both:

serve -s dist

serve dist

Pricing:
image
Docs:
image
Blog:
image

Steps to reproduce:

  1. clone repo
  2. pnpm install
  3. pnpm generate
  4. npm install -g serve
  5. serve -s dist or serve dist

did you ever resolve this? I have found that uncommenting the redirect inside the routeRules in nuxt.config.ts made it so the docs route would actually be found and not throw a 404 in static mode:
routeRules: {
'/api/search.json': { prerender: true },
// '/docs': { redirect: '/docs/getting-started', prerender: true }
},

commented

Will try, thanks.

@ilyabumblebee
To clarify though, simply removing it will just route to /docs, to make this work you need to pretender the /docs/getting-started route
routeRules: {
'/api/search.json': { prerender: true },
'/docs/getting-started': { prerender: true },
'/docs': { redirect: '/docs/getting-started', prerender: true }
},

commented

Works fine now with:

routeRules: {
  '/api/search.json': { prerender: true },
  '/docs/getting-started': { prerender: true },
  '/docs': { redirect: '/docs/getting-started', prerender: true }
}

Thanks!