nuxt / content

The file-based CMS for your Nuxt application, powered by Markdown and Vue components.
https://content.nuxt.com
MIT License
3.13k stars 628 forks source link

404 when redeploy #2137

Open gitFoxCode opened 1 year ago

gitFoxCode commented 1 year ago

Environment


Reproduction

  1. create any project using nuxt/content,
  2. do a deploy (or npm run generate),
  3. run a page (npm run preview),
  4. open website, go to some page,
  5. do a new deploy (npm run generate),
  6. run the page again (npm run preview),
  7. navigate the user to another subpage (eg. /about)

the result is a 404.

The user is forced to refresh the page by themselves

Describe the bug

After switching to another page when deploy was performed in the background, nuxt searches for the "old" file, which already has a different name

Additional context

How can I capture the change in chunks? Nuxt supposedly already supports changing chunks https://github.com/nuxt/nuxt/pull/19086, why doesn't nuxt-content do that? And how can I do it with my own? Without creating an infinite refreshing loop on the 404 page.

Logs

No response

PatrickMcGrath29 commented 2 months ago

I'm running into this same issue myself. I wonder if this issue would get addressed when this PR (https://github.com/nuxt/nuxt/pull/28160) gets merged in, since that'd reload the page when a chunk error is emitted. From what I can tell a chunk error gets raised at the same time as the Nuxt content 404. Ideally speaking though, it'd be nice if there was some way to avoid this behavior in Nuxt content directly.