nuxt / content

The file-based CMS for your Nuxt application, powered by Markdown and Vue components.
https://content.nuxt.com
MIT License
3.13k stars 627 forks source link

Page will not prerendered without static link to it #1508

Open cawa-93 opened 2 years ago

cawa-93 commented 2 years ago

Environment


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

farnabaz commented 2 years ago

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

/cc @danielroe @pi0

danielroe commented 2 years ago

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?