Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document not found under production environment with other files in /content directory #2602

Closed
qwerzl opened this issue Apr 3, 2024 · 0 comments · Fixed by #2607
Closed

Comments

@qwerzl
Copy link

qwerzl commented Apr 3, 2024

Environment

❯ nuxi info
------------------------------
- Operating System: Linux
- Node Version:     v18.18.0
- Nuxt Version:     3.11.1
- CLI Version:      3.11.1
- Nitro Version:    2.9.5
- Package Manager:  npm@10.2.3
- Builder:          -
- User Config:      modules
- Runtime Modules:  @nuxt/content@2.12.1, @nuxt/ui@2.15.0
- Build Modules:    -
------------------------------

Reproduction

https://stackblitz.com/edit/github-xx74jl?file=app.vue

Describe the bug

If there are unrelated files in the content directory (even if they are not imported anywhere), Nuxt Content will show Document not found error in production.

In the reproduction, I've added content/bad.ts. Dev mode works without errors but the error occurs in production environment.

Additional context

No response

Logs

[nuxt] [request error] [unhandled] [500] Cannot read properties of undefined (reading '_path')
  at eval (./.output/server/chunks/runtime.mjs:8344:52)  
  at Array.find (<anonymous>)  
  at fetchDirConfig (./.output/server/chunks/runtime.mjs:8344:32)  
  at eval (./.output/server/chunks/runtime.mjs:8378:63)  
  at Array.reduce (<anonymous>)  
  at eval (./.output/server/chunks/runtime.mjs:8378:39)  
  at async Object.eval [as handler] (./.output/server/chunks/runtime.mjs:8709:21)  
  at async Object.eval [as handler] (./.output/server/chunks/runtime.mjs:3052:19)  
  at async Server.toNodeHandle (./.output/server/chunks/runtime.mjs:3318:7)
@qwerzl qwerzl changed the title Document not found with other files in /content directory in production environment Document not found under production environment with other files in /content directory Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant