Open
Description
Environment
- Operating System: Darwin
- Node Version: v21.1.0
- Nuxt Version: 3.8.1
- CLI Version: 3.9.1
- Nitro Version: 2.7.2
- Package Manager: [email protected]
- Builder: -
- User Config: devtools, components, modules, runtimeConfig, app, image, css, content, nitro, build
- Runtime Modules: @nuxtjs/[email protected], @pinia/[email protected], @nuxt/[email protected], @nuxt/[email protected], [email protected], [email protected], @nuxtjs/[email protected]
- Build Modules: -
Reproduction
-
Create a page (example: /pages/demo.vue)
-
Add page meta different from the name of the file
Inside /pages/demo.vue:
<script setup>
definePageMeta({
path: '/foo',
});
</script>
- Use
npm run generate
Errors prerendering:
├─ /api/_content/query/2kJ8ihpm0Q.1700289623443.json (107ms) nitro 2:40:37 PM
│ ├── Error: [404] Document not found!
│ └── Linked from /demo
Describe the bug
When a page with definePageMeta()
's path
that does not match the file name is specified, it prevents the static site from being generated.
It works fine when using npm run dev
It would be nice to have this working to organize the /pages folder a bit more and put pages inside folders
(My original use case was to create a page with a path note/:id
instead of making a folder with only one catch-all page inside)
Additional context
No response
Logs
Errors prerendering:
├─ /api/_content/query/76BoSDA4U0.1700289877623.json (130ms) nitro 2:44:52 PM
│ ├── Error: [404] Document not found!
│ └── Linked from /demo
nitro 2:44:52 PM
ERROR Exiting due to prerender errors. 2:44:52 PM
at prerender (node_modules/nitropack/dist/shared/nitro.3d0a4b01.mjs:214:11)
at async node_modules/nuxt/dist/index.mjs:2986:7
at async build (node_modules/nuxt/dist/index.mjs:4375:5)
at async Object.run (node_modules/nuxi/dist/chunks/build.mjs:92:5)
at async Object.run (node_modules/nuxi/dist/chunks/generate.mjs:61:5)
at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.c6444792.mjs:1647:7)
at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.c6444792.mjs:1638:11)
at async runMain$1 (node_modules/nuxi/dist/shared/nuxi.c6444792.mjs:1770:7)
ERROR Exiting due to prerender errors.