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
queryContent doesn't work after nuxt build #2593
Comments
Do you mind creating a simple reproduction using the starter? https://nuxt.new/c/content |
I tried but even when I run build in the unmodified starter, I'm getting a: |
Try upgrading your Nuxt version, it'll work, |
Try |
thanks! Here you go: Sample When using nuxt dev and opening :3000/doc_1 |
Can confirm that a nuxi upgrade did the trick. Experienced the issue for the first time today. I was on the current version however. Not sure what went wrong. |
I would assume its related to a an issue I reported some time ago #2580 |
I did a npx nuxi upgrade and it's now using: Nuxt 3.11.2 with Nitro 2.9.6 |
I have this problem too. Following
works in Dev but not in Prod. Seems like it takes a moment for content to load and gets ignored in process. After a page reload content appears!
|
Unfortunately I have the same error.
This code gives me an empty array after build. Route rules are as follows.
|
This comment was marked as resolved.
This comment was marked as resolved.
@kevinhaeni I'm getting this same error and did a little digging in the lockfile to try and find it's origin. Looks like Did you ever find a resolution to this? Edit: Adding a solution that just worked for me.
|
Environment
"@nuxt/content": "^2.12.0",
"nuxt": "^3.10.2",
"vue": "^3.4.19",
Reproduction
slug.vue:
nuxt.config.ts:
Describe the bug
When running
nuxt dev
, everything works fine: calling localhost:3000/doc_1 shows the content of doc_1.json:However, when running
nuxt build
andnode .output/server/index.mjs
and doing the same request, I'm getting:I would expect that queryContent fetches the files from /content directory. I could swear that some days ago it did fetch data from some nuxt-content cache file (which would also not be good as my data in /content is dynamic.
Additional context
What confuses me is that under .output/server/chunks/raw/ I see a doc_1.mjs and a doc_2.mjs and the error seems to result from loading these files.
Logs
No response
The text was updated successfully, but these errors were encountered: