Closed StefanVDWeide closed 1 year ago
This sounds like a likely issue with nuxt/content. Can you try confirming which upgrade caused it? If it was nuxt/content, would you raise an issue there instead?
Would you be able to provide a reproduction? 🙏
@danielroe when trying to downgrade Nuxt/Content back to 2.6.0
and leaving Nuxt at 3.7.3
I'm having the same issue where locally everything is generated, but on my prod environment the dynamic pages are skipped.
Some more context, these are the errors I'm seeing in the console. It seems the JSON
payloads are missing and causing issues down the line.
GET https://studioterabyte.nl/blog/serverless-stack/_payload.json 404
entry.4513e066.js:1 [nuxt] Cannot load payload /blog/serverless-stack/_payload.json SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
Interestingly, when downgrading Nuxt to 3.4.3
and leaving Nuxt/Content at 2.8.2
the pages are generated again as expected. So it seems an issue on the Nuxt side of things.
Looks like I'm not the only one with this issue too: https://stackoverflow.com/questions/77077036/nuxt-3-static-site-payload-json-not-found-404-due-to-wrong-route-on-request#comment136014809_77077036
A reproduction would be very helpful then.
Alright, while setting up the reproduction everything of course worked perfectly.
Looking at the differences between the reproduction and what I have installed for my website, I noticed a difference in Nuxt/i18n versions. The repoduction used the latest RC version and my own site the Edge version. After upgrading my own version to the latest RC one, and turning off the experimental payload extraction, everything seems to be working again.
For some reason the incorrect locale paths were generated and skipped over during the generate phase. Turning off the payload extraction ensured that when I switch locale when on a dynamic page, the page itself also changes.
Not sure what is going wrong between Nuxt and the i18n edge version but I'm glad this is resolved.
Thanks for the quick response!
Environment
Darwin
v20.3.1
3.7.3
3.9.0
2.6.3
npm@9.6.7
-
experimental
,app
,runtimeConfig
,modules
,content
,site
,i18n
@nuxt/content@2.8.2
,@nuxtjs/i18n@8.0.0-rc.4-28252997.568c274
,@nuxt/image@1.0.0-rc.2
,@nuxtjs/tailwindcss@6.8.0
,nuxt-simple-sitemap@3.3.4
-
Reproduction
N/A
Describe the bug
When running
npm run generate
locally all the pages in my/content
folder are being generated. However, when deploying to render.com and having it run the same command to generate the static content, all the dynamic pages are skipped over. This results in 404 errors when trying to navigate to those pages.The dynamic pages are all being linked to from a blog page overview
/blog
where each entry has a specific link e.g./blog/example
. The blog overview page is rendered correctly since this is not based on a markdown file but rather a.vue
file.My content folder looks fairly standard:
This setup has always worked, only after upgrading to Nuxt/Content
2.8.2
from2.6.0
and Nuxt itself from3.4.3
to3.7.3
it started failing on render.com. Reverting back does solve this issue but isn't ideal ofcourse.I've attached the build logs from a local sucessful build and an incomplete build on render.com
Locally: https://pastebin.com/fs6kXcV2 render.com: https://pastebin.com/g5yvS0PS
Thanks!
Additional context
No response
Logs
No response