-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Hydration mismatch only occurs when reloading in the production build. #4231
Comments
Your plugin seems to be generating div inside p which will break html <p><a href="https://github.com/vuejs/core-vapor/blob/30583b9ee1c696d3cb836f0bfd969793e57e849d/packages/compiler-vapor/src/ir/index.ts#L22" target="_blank" rel="noreferrer"><div class="github-source"> first point - https://vuejs.org/guide/scaling-up/ssr.html#hydration-mismatch |
Oops! I see, I completely missed that. |
Might be much easier to do this from a vite plugin rather than a markdown-it one. 👀 |
I had a similar issue with invalid html 'silently' breaking my interactive pages: #4191 It would be super useful if there was some way of having html errors break the build, so I don't have to run docs:preview then visit every page looking for "hydration completed but contains mismatches" warnings in the console. |
@ms264556 I'm not sure if there is any easy way to do that. People usually have e2e tests for those kind of things that capture browser warnings and errors for all entries in sitemap. Alternatively if you want only the invalid html related errors, then there is https://html-validate.org/ which is what Nuxt uses in one of their modules. |
Yes, I have this now 😏. I'd been hoping your SSG had visibility into the hydration process, so that this request would be straightforward. |
Describe the bug
Possible similar issues:
Hydration mismatch occurs only when reloading a specific page in the production build.
It can be reproduced locally as well.
It doesn’t happen in the development build, nor when navigating through the sidebar.
2024-09-25.20.40.13.mov
Reproduction
This repository (my product)
https://github.com/ubugeeei/reading-vuejs-core-vapor
※ During the initial build, a fetch to GitHub will run, so it may take a little time.
(From the second time onward, the cache will be used)
The plugin implementation is here.
https://github.com/ubugeeei/reading-vuejs-core-vapor/tree/9fa8c614c6047241dc2a6bdac39dca1815318d6a/.vitepress/plugins/markdown-it/github
Expected behavior
Hydration should complete normally and the screen should render correctly even after reloading.
System Info
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: