content
content copied to clipboard
404 error not triggering when using DocumentDriven and subfolders with [...slug].vue
Environment
- Operating System: Windows_NT
- Node Version: v18.14.0
- Nuxt Version: 3.9.3
- CLI Version: 3.10.0
- Nitro Version: 2.8.1
- Package Manager: [email protected]
- Builder: -
- User Config: -
- Runtime Modules: -
- Build Modules: -
Reproduction
- Create a project with DocumentDriven: true
- Create the DocumentDrivenEmpty.vue and DocumentDrivenNotFound.vue components
- Test it on the root folder, i.e: /this-returns-404, it works
- Create a subfolder, i.e: /blog, with a [...slug].vue
- Navigate to any invalid path within the /blog subfolder, does not return 404.
Describe the bug
Handling 404 errors using the DocumentDriven flag is currently only working at root level documents. Any documents in subfolders with a [...slug].vue file are not working at all, it just returns the slug page. Even when handled properly on the slug page with v-if and manually renderind the NotFound component, the response is returned 200 and not 404.
Additional context
No response
Logs
No response