#nuxt/content ssr?

1 messages · Page 1 of 1 (latest)

cinder steppeBOT
#

Hi @neat flame. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

The knowledge sources don’t directly describe SSR problems specific to @nuxt/content blog routes, so I can’t give a precise, guaranteed fix. But a few relevant points are clear:

  1. Nuxt 3 + Nuxt Content is SSR-capable by default
    Nuxt 3 apps are server‑rendered unless you explicitly disable SSR (globally or via route rules). If your /blog pages only render after client navigation, it usually means:

    • SSR is disabled (e.g. ssr: false in nuxt.config or a route rule like { '/blog/**': { ssr: false } }), or
    • The content is rendered in a purely client‑only component (e.g. using browser‑only APIs).

    There’s no indication in the sources that @nuxt/content itself prevents SSR.

  2. How to check if your blog is actually SSR’d
    One source shows how to verify whether a page and its content are server‑rendered:

    • In the browser devtools console, run:
      window.__NUXT__.serverRendered
      
      If it’s true, the page is SSR’d. [Is content SSR]
    • Or use “View Page Source” and search for some unique blog text; if it appears in the HTML source, that content was rendered on the server. [Is content SSR]

    If a hard reload of /blog/[slug] shows no blog text in “View Page Source”, then that content is not being SSR’d.

  3. Client-only vs server components
    Another source shows using a .server.vue component to ensure markdown is rendered on the server for SEO. [Markdown SSR]
    If your blog rendering lives in a client‑only component (or uses browser‑only APIs), Nuxt will push that work to the client and you’ll see exactly the behavior you describe (nothing on hard reload, content appears only after hydration).

#

In that example, they:

  • Enable experimental.componentIslands in nuxt.config
  • Create HighlightedMarkdown.server.vue that converts markdown to HTML on the server and outputs it with v-html. [Markdown SSR]

The same pattern can be used for blog content: ensure the component that turns markdown/content into HTML is allowed to run on the server (e.g. not marked client‑only).

  1. What I can’t see from the sources
    • There’s no explicit mention of a bug where @nuxt/content pages fail on hard reload.
    • There’s no concrete nuxt.config example for @nuxt/content + SSR in these documents.

Because of that, I can’t say exactly why your /blog/* fails on reload, only that:

  • Nuxt 3 SSR works and can be verified as above. [Is content SSR]
  • Server‑side markdown rendering for SEO is possible and demonstrated with a .server.vue component. [Markdown SSR]

If you share your nuxt.config and how you render the blog content (page + components), you can compare against these two checks:

  1. Is SSR globally or per‑route disabled?
  2. Is the component that renders the blog content allowed to run on the server (not client‑only, not using browser‑only APIs)?

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@neat flame Kapa.ai is still learning and improving, please let me know how I did by reacting below.

neat flame
#

@cinder steppe

cinder steppeBOT
#

Let me check the knowledge base for you again. One moment! :books: