content icon indicating copy to clipboard operation
content copied to clipboard

Page will not prerendered without static link to it

Open cawa-93 opened this issue 3 years ago • 3 comments

Environment


  • Operating System: Linux
  • Node Version: v16.14.2
  • Nuxt Version: 3.0.0-rc.9
  • Nitro Version: 0.5.1
  • Package Manager: [email protected]
  • Builder: vite
  • User Config: modules
  • Runtime Modules: @nuxt/[email protected]
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-jdzmbl-wb6gqy?file=pages%2F[...query].vue

Describe the bug

In demo you can find navigation. There is /arts link. This "link" is not actual a semantic link, because some component library like element-plus make navigation without semantic links.

If you try navigate to /arts after generation you will got 404.

Additional context

No response

Logs

No response

cawa-93 avatar Sep 08 '22 14:09 cawa-93

This is related to Nuxt's pre-render crawler. The $router links are not detected during page crawl.

/cc @danielroe @pi0

farnabaz avatar Sep 12 '22 13:09 farnabaz

I'm not quite sure we'd want to support this usage. We do however support auto-discovery of additional routes via adding them via the x-nitro-prerender header, and might consider adding a tree-shakeable composable to nuxt core to allow this to be easier. wdyt @pi0?

danielroe avatar Sep 12 '22 14:09 danielroe