Hydration repeats markdown rendering #551
-
My site https://grammy.dev uses a lot of inline code snippets. They tend to get longer sometimes, such as Hence, I wrote a small plugin that inserts Notice how the little note under the code snippet has parts of the text repeated? This bug:
It only happens when actually building the site, and then waiting for it to hydrate. I don't even know if the problem is in my plugin or in VuePress itself, but I suspect I'm doing something wrong. How is this possible? My plugin code never reaches the browser (right???) so how can it affect the JavaScript there? Why does hydration duplicate nodes in the DOM? Did I cause some weird side-effects that make this happen? I am clueless and thankful for any explanations, be it about internals that could point me in the right direction. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Seems that it's cause by hydration mismatch (or called ssr-mismatch), i.e. the server-rendered result (or after loaded by browser) is different from the client-rendered result. |
Beta Was this translation helpful? Give feedback.
Seems that it's cause by hydration mismatch (or called ssr-mismatch), i.e. the server-rendered result (or after loaded by browser) is different from the client-rendered result.