content icon indicating copy to clipboard operation
content copied to clipboard

Why does Nuxt Content display "content not found" after refreshing the page using F5, whereas it functions properly during the initial visit?

Open TangsWang opened this issue 1 year ago • 12 comments

Environment


  • Operating System: Windows_NT
  • Node Version: v18.16.0
  • Nuxt Version: 3.7.0
  • CLI Version: 3.7.3
  • Nitro Version: 2.6.2
  • Package Manager: [email protected]
  • Builder: -
  • User Config: modules, app, css, srcDir, runtimeConfig, routeRules, router, hooks, build, vite, nitro, vueuse, unocss
  • Runtime Modules: @vueuse/[email protected], @unocss/[email protected], @nuxt/[email protected]
  • Build Modules: -

Reproduction

just install @nuxt/content and use official template, set page to ssr.

Describe the bug

Nuxt Content display "content not found" after refreshing the page using F5, whereas it functions properly during the initial visit

Additional context

No response

Logs

No response

TangsWang avatar Oct 15 '23 05:10 TangsWang

also with warn:

WARN [nuxt] Two component files resolving to the same name ProseCode: 13:58:41

  • D:/Nuxt3-Apps/ai-tools-app/node_modules/@nuxtjs/mdc/dist/runtime/components/prose/ProseCode.vue
  • D:/Nuxt3-Apps/ai-tools-app/node_modules/@nuxt/content/dist/runtime/components/Prose/ProseCode.vue

TangsWang avatar Oct 15 '23 06:10 TangsWang

if i set render mode to prerender, content not found too.

TangsWang avatar Oct 15 '23 06:10 TangsWang

I encountered the same issue in nuxt 3.8. After enabling document mode and refreshing the page, it shows "content not found". Clicking on the routes displays the content correctly, so it seems to be an issue with SSR (Server-Side Rendering). I had to roll back to nuxt 3.74 where everything works fine.

popdo avatar Oct 24 '23 08:10 popdo

I have no idea why the error happens, but sometimes you just need to remove the .nuxt directory

natanfeitosa avatar Oct 28 '23 07:10 natanfeitosa

This is still broken.

bryancurran avatar Mar 09 '24 15:03 bryancurran

Jepp, still broken, but only after deploying the static site while in dev all works fine.

Refreshing the page will suddenly show the content, but during routing it is not working

mklueh avatar Mar 14 '24 08:03 mklueh

Weirdly enough, I'm getting the opposite. Works on refresh but gives me a not found error on routing via NuxtLink

raf202 avatar May 26 '24 20:05 raf202

Hello. Any update on this ? I m facing the exact same problem with nuxt 3

devstack-be avatar Jul 01 '24 12:07 devstack-be

My middleware was blocking the request on the api/_content

devstack-be avatar Jul 03 '24 21:07 devstack-be

My middleware was blocking the request on the api/_content

Thx devstack-be for the middleware hint! ^^ I had basic auth via the Nuxt Security module enabled and apparently this blocked the Content API Route during SSR / site refresh.

Simlor avatar Jul 09 '24 16:07 Simlor

you're welcome ;)

devstack-be avatar Jul 09 '24 16:07 devstack-be