Skip to content

QMarkdown not rendering during SSR (hydration mismatch) #410

@f3k-freek

Description

@f3k-freek

Describe the bug

When using @quasar/quasar-ui-qmarkdown in an SSR + SPA Quasar project, hydration fails because the component renders nothing on the server, but a <div> on the client. This results in Vue’s hydration mismatch warning:

[Vue warn]: Hydration node mismatch:
- rendered on server: 
- expected on client: div
  at <QMarkdown src="# hello world" >

This effectively means the markdown is not being rendered at SSR time.


To Reproduce

Steps to reproduce the behavior:

  1. Create a new Quasar project in SSR mode (quasar create ... --mode ssr)

  2. Install extension:

    quasar ext add @quasar/qmarkdown

  3. Use QMarkdown inside a page/component:

  4. Run in SSR mode (quasar dev -m ssr)

  5. Open the page and check browser console → hydration warning.

  6. Check raw server-rendered HTML (view-source:) → the q-markdown output is missing.


Expected behavior

The markdown should be parsed and rendered to HTML on the server, so that server-rendered HTML and client-rendered HTML match. No hydration errors should occur.


Screenshots

N/A


Desktop (please complete the following information)

  • OS: macOS 15.6.1
  • Browser: Chromium: 138.0.7204.157
  • Quasar: 2.16.0
  • Quasar/cli: 2.5.0
  • @quasar/quasar-ui-qmarkdown: 2.0.5 (installed via quasar ext add @quasar/qmarkdown)

Smartphone (please complete the following information)

(not tested, SSR hydration issue is reproducible on desktop)


Additional context

  • When hardcoding <q-markdown src="# hello world" />, the issue still occurs, so it’s not related to dynamic content.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions