Hydration completed but contains mismatches. #3295
-
client报错 Hydration completed but contains mismatches. SSR生成的html中包含了 三个标签的及内容,客户端运行时重复插入以上三个标签及内容,有人遇到过吗?替换了Navbar组件,取消替换就能正常,但不知道问题在哪里,什么情况触发的mismatches |
Beta Was this translation helpful? Give feedback.
Answered by
Mister-Hope
Sep 5, 2023
Replies: 3 comments 1 reply
-
这是你自己的代码问题,贴这几个字是指望别人给你算一卦么? |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Mister-Hope
-
是的,我也不知道哪里的问题,用标签重写了navtab就组件就有问题,应该是SSR生成的代码和客户端展现的不一致,用<ClientOnly>标签把navtab包起来就没了
Mr.Hope ***@***.***> 于2023年9月5日周二 13:28写道:
… 这是你自己的代码问题,贴这几个字是指望别人给你算一卦么?
—
Reply to this email directly, view it on GitHub
<#3295 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA6CW4MGBWJ3SKUWB2ZYL4TXY2Z7BANCNFSM6AAAAAA2LJWLNU>
.
You are receiving this because you authored the thread.Message ID:
<vuepress-theme-hope/vuepress-theme-hope/repo-discussions/3295/comments/6910074
@github.com>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
我并不是专做前端的,赶工就没时间去细查了。
查阅vuepress
SSR相关部分的文档,记得大概意思是为了让node渲染的内容和浏览器看到的一致,会进行某种验证,目的是为了服务端和客户端之间的数据传输不出问题,如果验证不一致就会出现这个报错。
Mr.Hope ***@***.***> 于2023年9月7日周四 20:54写道:
… 是的用clientonly 的确是一个很有效的方法,但是你正道还是自己排查,哪里会在浏览器和客户端导致渲染不一致?
—
Reply to this email directly, view it on GitHub
<#3295 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA6CW4OXPNC7TJBR6KNRW53XZG7YXANCNFSM6AAAAAA2LJWLNU>
.
You are receiving this because you authored the thread.Message ID:
<vuepress-theme-hope/vuepress-theme-hope/repo-discussions/3295/comments/6937116
@github.com>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
这是你自己的代码问题,贴这几个字是指望别人给你算一卦么?