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

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

Open
TangsWang opened this issue Oct 15, 2023 · 14 comments

Comments

@TangsWang
Copy link

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: yarn@1.22.19
  • Builder: -
  • User Config: modules, app, css, srcDir, runtimeConfig, routeRules, router, hooks, build, vite, nitro, vueuse, unocss
  • Runtime Modules: @vueuse/nuxt@9.13.0, @unocss/nuxt@0.51.13, @nuxt/content@2.8.5
  • 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
Copy link
Author

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
Copy link
Author

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

@danielroe danielroe transferred this issue from nuxt/nuxt Oct 15, 2023
@popdo
Copy link

popdo commented Oct 24, 2023

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.

@natanfeitosa
Copy link

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

@bryancurran
Copy link

This is still broken.

@mklueh
Copy link

mklueh commented Mar 14, 2024

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

@raf202
Copy link

raf202 commented May 26, 2024

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

@devstack-be
Copy link

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

@devstack-be
Copy link

My middleware was blocking the request on the api/_content

@Simlor
Copy link

Simlor commented Jul 9, 2024

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.

@devstack-be
Copy link

you're welcome ;)

@llds66
Copy link

llds66 commented Aug 27, 2024

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

How to solve it? The ContentList of my development environment refreshes normally, and after deployment it refreshes No articles found.

Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Oct 27, 2024
@Achuttarsing
Copy link

Any news regarding this issue?

@github-actions github-actions bot removed the Stale label Nov 7, 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

No branches or pull requests

10 participants