nuxt / content

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

override prose components cause hydration mismatch #2640

Closed enpitsuLin closed 1 month ago

enpitsuLin commented 1 month ago

Environment


Reproduction

https://github.com/enpitsuLin/nuxt-prose-component-repo

Describe the bug

I just override prose component <ProseImg/> and want get caption under image, but got hydration mismatch warning

after some try, just found if override prose components with other unexpected element wrap it that will cause hydration mismatch, I think maybe it's some things wrong with inheritAttrs option, but it's still keep warning after added inheritAttrs:false

my ProseImg ```html ```
image

Additional context

No response

Logs

No response

enpitsuLin commented 1 month ago

And I also have some more complex situation, like replace some <a/> tag in body with content:file:afterParse hook to use custom component will cause hydration mismatch which looks like same issue of this

enpitsuLin commented 1 month ago

open a new issue on upstream https://github.com/nuxt-modules/mdc/issues/212