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 628 forks source link

No Content In Static Sites #2614

Open codetheorist opened 7 months ago

codetheorist commented 7 months ago

Environment

Nuxt project info: 17:36:04


Reproduction

I can't provide this as the repository is private. This will be simple. Default setup, any amount of content pages and run "npm run generate" and the content is not rendered.

Describe the bug

Using static site generation the content is not rendered, with the message "Document not found, overwrite this content with #not-found slot in ". I've noticed from the log files that the front end is trying to load the file N18xLDS7aK.1713198763387.json when the content cache file that exists is actually called "cache.1713198763387.json".

Additional context

No response

Logs

$ npx nuxi start
                                                                                                                                                      17:33:26
 ╭─────────────────────────────────────Preview Mode────────────────────────────────────────╮
 │                                                                                         │
 │  You are running Nuxt production build in preview mode.                                 │
 │  For production deployments, please directly use npx serve ./public command.            │
 │                                                                                         │
 │  Node.js:           v18.19.0                                                            │
 │  Nitro Preset:      static                                                              │
 │  Working directory: .output                                                             │
 │                                                                                         │
 ╰─────────────────────────────────────────────────────────────────────────────────────────╯

ℹ Loading .env. This will not be loaded when running the server in production.                                                                       17:33:26   
ℹ Starting preview command: npx serve ./public                                                                                                       17:33:26   
                                                                                                                                                      17:33:26  
 INFO  Accepting connections at http://localhost:3000
 HTTP  15/04/2024 17:33:37 127.0.0.1 GET /
 HTTP  15/04/2024 17:33:37 127.0.0.1 Returned 200 in 18 ms
 HTTP  15/04/2024 17:33:37 127.0.0.1 GET /_nuxt/entry.ChTp9thF.js
 HTTP  15/04/2024 17:33:37 127.0.0.1 GET /_nuxt/index.C5UW9Uso.js
 HTTP  15/04/2024 17:33:37 127.0.0.1 GET /_nuxt/_plugin-vue_export-helper.DlAUqK2U.js
 HTTP  15/04/2024 17:33:37 127.0.0.1 GET /_payload.json
 HTTP  15/04/2024 17:33:37 127.0.0.1 Returned 200 in 2 ms
 HTTP  15/04/2024 17:33:37 127.0.0.1 Returned 200 in 2 ms
 HTTP  15/04/2024 17:33:37 127.0.0.1 Returned 200 in 2 ms
 HTTP  15/04/2024 17:33:37 127.0.0.1 Returned 200 in 9 ms
 HTTP  15/04/2024 17:33:37 127.0.0.1 GET /favicon.ico
 HTTP  15/04/2024 17:33:37 127.0.0.1 GET /_nuxt/error-404.B_Sghdke.js
 HTTP  15/04/2024 17:33:37 127.0.0.1 Returned 404 in 4 ms
 HTTP  15/04/2024 17:33:37 127.0.0.1 GET /_nuxt/nuxt-link.DhHX6fbN.js
 HTTP  15/04/2024 17:33:37 127.0.0.1 GET /_nuxt/error-500.B6kOgpjz.js
 HTTP  15/04/2024 17:33:37 127.0.0.1 Returned 200 in 3 ms
 HTTP  15/04/2024 17:33:37 127.0.0.1 GET /_nuxt/builds/meta/20d147ce-6801-4256-848c-205b68b62198.json
 HTTP  15/04/2024 17:33:37 127.0.0.1 Returned 200 in 3 ms
 HTTP  15/04/2024 17:33:37 127.0.0.1 Returned 200 in 2 ms
 HTTP  15/04/2024 17:33:37 127.0.0.1 Returned 200 in 2 ms
 HTTP  15/04/2024 17:33:40 127.0.0.1 GET /
 HTTP  15/04/2024 17:33:40 127.0.0.1 Returned 304 in 2 ms
 HTTP  15/04/2024 17:33:40 127.0.0.1 GET /_nuxt/entry.ChTp9thF.js
 HTTP  15/04/2024 17:33:40 127.0.0.1 GET /_nuxt/index.C5UW9Uso.js
 HTTP  15/04/2024 17:33:40 127.0.0.1 GET /_nuxt/_plugin-vue_export-helper.DlAUqK2U.js
 HTTP  15/04/2024 17:33:40 127.0.0.1 GET /_payload.json
 HTTP  15/04/2024 17:33:40 127.0.0.1 Returned 304 in 2 ms
 HTTP  15/04/2024 17:33:40 127.0.0.1 Returned 304 in 2 ms
 HTTP  15/04/2024 17:33:40 127.0.0.1 Returned 304 in 2 ms
 HTTP  15/04/2024 17:33:40 127.0.0.1 Returned 304 in 2 ms
 HTTP  15/04/2024 17:33:40 127.0.0.1 GET /_nuxt/error-404.B_Sghdke.js
 HTTP  15/04/2024 17:33:40 127.0.0.1 Returned 200 in 0 ms
 HTTP  15/04/2024 17:33:40 127.0.0.1 GET /_nuxt/nuxt-link.DhHX6fbN.js
 HTTP  15/04/2024 17:33:40 127.0.0.1 GET /_nuxt/error-500.B6kOgpjz.js
 HTTP  15/04/2024 17:33:40 127.0.0.1 Returned 304 in 1 ms
 HTTP  15/04/2024 17:33:40 127.0.0.1 Returned 304 in 1 ms
 HTTP  15/04/2024 17:33:40 127.0.0.1 GET /_nuxt/builds/meta/20d147ce-6801-4256-848c-205b68b62198.json
 HTTP  15/04/2024 17:33:40 127.0.0.1 Returned 304 in 1 ms
 HTTP  15/04/2024 17:33:46 127.0.0.1 GET /privacy-policy
 HTTP  15/04/2024 17:33:46 127.0.0.1 Returned 404 in 1 ms
 HTTP  15/04/2024 17:33:46 127.0.0.1 GET /_nuxt/entry.ChTp9thF.js
 HTTP  15/04/2024 17:33:46 127.0.0.1 Returned 304 in 1 ms
 HTTP  15/04/2024 17:33:46 127.0.0.1 GET /_nuxt/_...slug_.LpIRpo0e.js
 HTTP  15/04/2024 17:33:46 127.0.0.1 GET /_nuxt/ContentDoc.DYf4Ctin.js
 HTTP  15/04/2024 17:33:46 127.0.0.1 GET /_nuxt/ContentRendererMarkdown.vue.CSehzimr.js
 HTTP  15/04/2024 17:33:46 127.0.0.1 GET /_nuxt/ContentRenderer.DgN2v7Cw.js
 HTTP  15/04/2024 17:33:46 127.0.0.1 GET /_nuxt/preview.C5pWxvst.js
 HTTP  15/04/2024 17:33:46 127.0.0.1 GET /_nuxt/ContentQuery.B46mvXCr.js
 HTTP  15/04/2024 17:33:46 127.0.0.1 Returned 200 in 4 ms
 HTTP  15/04/2024 17:33:46 127.0.0.1 Returned 200 in 5 ms
 HTTP  15/04/2024 17:33:46 127.0.0.1 Returned 200 in 3 ms
 HTTP  15/04/2024 17:33:46 127.0.0.1 Returned 200 in 3 ms
 HTTP  15/04/2024 17:33:46 127.0.0.1 Returned 200 in 4 ms
 HTTP  15/04/2024 17:33:46 127.0.0.1 Returned 200 in 4 ms
 HTTP  15/04/2024 17:33:46 127.0.0.1 GET /_nuxt/query.CGuflXUw.js
 HTTP  15/04/2024 17:33:46 127.0.0.1 GET /_nuxt/index.BsYmvPZw.js
 HTTP  15/04/2024 17:33:46 127.0.0.1 GET /_nuxt/error-404.B_Sghdke.js
 HTTP  15/04/2024 17:33:46 127.0.0.1 Returned 200 in 3 ms
 HTTP  15/04/2024 17:33:46 127.0.0.1 GET /_nuxt/nuxt-link.DhHX6fbN.js
 HTTP  15/04/2024 17:33:46 127.0.0.1 GET /_nuxt/_plugin-vue_export-helper.DlAUqK2U.js
 HTTP  15/04/2024 17:33:46 127.0.0.1 Returned 304 in 3 ms
 HTTP  15/04/2024 17:33:46 127.0.0.1 Returned 304 in 1 ms
 HTTP  15/04/2024 17:33:46 127.0.0.1 GET /_nuxt/error-500.B6kOgpjz.js
 HTTP  15/04/2024 17:33:46 127.0.0.1 Returned 304 in 2 ms
 HTTP  15/04/2024 17:33:46 127.0.0.1 Returned 304 in 1 ms
 HTTP  15/04/2024 17:33:46 127.0.0.1 Returned 200 in 5 ms
 HTTP  15/04/2024 17:33:46 127.0.0.1 GET /_nuxt/_plugin-vue_export-helper.DlAUqK2U.js
 HTTP  15/04/2024 17:33:46 127.0.0.1 Returned 304 in 0 ms
 HTTP  15/04/2024 17:33:46 127.0.0.1 GET /_nuxt/builds/meta/20d147ce-6801-4256-848c-205b68b62198.json
 HTTP  15/04/2024 17:33:46 127.0.0.1 Returned 304 in 1 ms
 HTTP  15/04/2024 17:33:46 127.0.0.1 GET /api/_content/query/Cr3vX64g4U.1713198763387.json?_params=%7B%22first%22:true,%22where%22:%5B%7B%22_path%22:%22%2Fprivacy-policy%22%7D%5D,%22sort%22:%5B%7B%22_file%22:1,%22$numeric%22:true%7D%5D%7D
 HTTP  15/04/2024 17:33:46 127.0.0.1 Returned 404 in 1 ms
 HTTP  15/04/2024 17:33:51 127.0.0.1 GET /pages/privacy-policy
 HTTP  15/04/2024 17:33:51 127.0.0.1 Returned 404 in 2 ms
 HTTP  15/04/2024 17:33:51 127.0.0.1 GET /_nuxt/entry.ChTp9thF.js
 HTTP  15/04/2024 17:33:51 127.0.0.1 Returned 304 in 1 ms
 HTTP  15/04/2024 17:33:51 127.0.0.1 GET /_nuxt/_...slug_.LpIRpo0e.js
 HTTP  15/04/2024 17:33:51 127.0.0.1 GET /_nuxt/ContentDoc.DYf4Ctin.js
 HTTP  15/04/2024 17:33:51 127.0.0.1 Returned 304 in 2 ms
 HTTP  15/04/2024 17:33:51 127.0.0.1 GET /_nuxt/ContentRenderer.DgN2v7Cw.js
 HTTP  15/04/2024 17:33:51 127.0.0.1 GET /_nuxt/ContentRendererMarkdown.vue.CSehzimr.js
 HTTP  15/04/2024 17:33:51 127.0.0.1 GET /_nuxt/index.BsYmvPZw.js
 HTTP  15/04/2024 17:33:51 127.0.0.1 GET /_nuxt/preview.C5pWxvst.js
 HTTP  15/04/2024 17:33:51 127.0.0.1 Returned 304 in 3 ms
 HTTP  15/04/2024 17:33:51 127.0.0.1 Returned 304 in 2 ms
 HTTP  15/04/2024 17:33:51 127.0.0.1 Returned 304 in 1 ms
 HTTP  15/04/2024 17:33:51 127.0.0.1 Returned 304 in 2 ms
 HTTP  15/04/2024 17:33:51 127.0.0.1 GET /_nuxt/ContentQuery.B46mvXCr.js
 HTTP  15/04/2024 17:33:51 127.0.0.1 Returned 304 in 1 ms
 HTTP  15/04/2024 17:33:51 127.0.0.1 GET /_nuxt/query.CGuflXUw.js
 HTTP  15/04/2024 17:33:51 127.0.0.1 GET /_nuxt/error-404.B_Sghdke.js
 HTTP  15/04/2024 17:33:51 127.0.0.1 GET /_nuxt/nuxt-link.DhHX6fbN.js
 HTTP  15/04/2024 17:33:51 127.0.0.1 GET /_nuxt/_plugin-vue_export-helper.DlAUqK2U.js
 HTTP  15/04/2024 17:33:51 127.0.0.1 Returned 304 in 2 ms
 HTTP  15/04/2024 17:33:51 127.0.0.1 Returned 304 in 1 ms
 HTTP  15/04/2024 17:33:51 127.0.0.1 Returned 304 in 1 ms
 HTTP  15/04/2024 17:33:51 127.0.0.1 Returned 304 in 2 ms
 HTTP  15/04/2024 17:33:51 127.0.0.1 Returned 304 in 2 ms
 HTTP  15/04/2024 17:33:51 127.0.0.1 GET /_nuxt/error-500.B6kOgpjz.js
 HTTP  15/04/2024 17:33:51 127.0.0.1 Returned 304 in 1 ms
 HTTP  15/04/2024 17:33:51 127.0.0.1 GET /_nuxt/_plugin-vue_export-helper.DlAUqK2U.js
 HTTP  15/04/2024 17:33:51 127.0.0.1 Returned 304 in 0 ms
 HTTP  15/04/2024 17:33:51 127.0.0.1 GET /favicon.ico
 HTTP  15/04/2024 17:33:51 127.0.0.1 Returned 404 in 2 ms
 HTTP  15/04/2024 17:33:51 127.0.0.1 GET /_nuxt/builds/meta/20d147ce-6801-4256-848c-205b68b62198.json
 HTTP  15/04/2024 17:33:51 127.0.0.1 Returned 304 in 0 ms
 HTTP  15/04/2024 17:33:51 127.0.0.1 GET /api/_content/query/N18xLDS7aK.1713198763387.json?_params=%7B%22first%22:true,%22where%22:%5B%7B%22_path%22:%22%2Fpages%2Fprivacy-policy%22%7D%5D,%22sort%22:%5B%7B%22_file%22:1,%22$numeric%22:true%7D%5D%7D
jasonsims commented 3 months ago

I had a similar issue and needed to tell Nitro to prerender the root after installing @nuxt/content for some reason.

// nuxt.config.ts
nitro: {
  prerender: {
    routes: ['/']
  }
}