Nuxt Content for Static Site Generation
Hi,
I'm using Nuxt Content with markdown files. It works fine in development and when I generate production builds. The problem occurs when I try to disable SSR (Server-Side Rendering). An error appears when loading a markdown file:
Document not found, overwrite this content with #not-found slot in <ContentDoc>.
13 Replies
You need ssr true for it to create the content correctly. You can still run
generate
with ssr true.Yes, of course. But if i want a static site, i can't use content ?
Yes you can. Post your nuxt config and what command you’re using to generate
Command is :
npm run generate
this needs to be true.
ssr: false,
What ?
"Server side rendering" need to be disabled for static site.
You can enable client-side only rendering with Nuxt in your nuxt.config.ts:
Read this again
If you have
documentDriven: true
and ssr: false
, try also enabling experimental: { clientDB: true }
I've tried this before and it doesn't seem to be very reliable. Didn't spend too much time on it but it wouldn't generate my other locales besides default.
It’s worth the OP giving it a try since they’re adamant they don’t need ssr enabled (?). No evidence of locales given in their instance.
With
documentDriven: true
, same error in production : Document not found, overwrite this content with #not-found slot in <ContentDoc>.