所以在我的Nuxt universal-mode应用程序中,有时会出现一个错误,该错误会上升:
vue.runtime.esm.js:620 [Vue warn]: The client-side rendered virtual DOM tree is not matching server-rendered content. This is likely caused by incorrect HTML markup, for example nesting block-level elements inside <p>, or missing <tbody>. Bailing hydration and performing full client-side render.
通常会出现第二个(实际上第二个有时会上升而没有第一个,而不是相反):
TypeError: Cannot read property 'toLowerCase' of undefined
at emptyNodeAt (vue.runtime.esm.js:5851)
at VueComponent.patch [as __patch__] (vue.runtime.esm.js:6492)
at VueComponent.Vue._update (vue.runtime.esm.js:3933)
at VueComponent.updateComponent (vue.runtime.esm.js:4048)
at Watcher.get (vue.runtime.esm.js:4467)
at new Watcher (vue.runtime.esm.js:4456)
at mountComponent (vue.runtime.esm.js:4061)
at VueComponent.Vue.$mount (vue.runtime.esm.js:8399)
at init (vue.runtime.esm.js:3115)
at hydrate (vue.runtime.esm.js:6362)
然后没有任何作用,因为当我单击应用程序中的另一个页面时,我得到:
client.js:134 TypeError: Cannot read property '_transitionClasses' of undefined
at Array.updateClass (vue.runtime.esm.js:6799)
at patchVnode (vue.runtime.esm.js:6298)
at updateChildren (vue.runtime.esm.js:6177)
at patchVnode (vue.runtime.esm.js:6303)
at updateChildren (vue.runtime.esm.js:6177)
at patchVnode (vue.runtime.esm.js:6303)
at updateChildren (vue.runtime.esm.js:6177)
at patchVnode (vue.runtime.esm.js:6303)
at updateChildren (vue.runtime.esm.js:6177)
at patchVnode (vue.runtime.esm.js:6303)
我大部分都理解为什么发生这种情况,尽管发生这种情况时,我不知道从何开始服务器端版本和客户端版本。因此,当此问题出现时,我唯一能做的就是回滚到以前的git commit,直到问题解决为止……不幸的是,它无法很好地工作,因为有时该错误会出现在代码版本中以前有。
通常,解决方案是删除尽可能多的内容(.nuxt
,node_install
),并从头开始设置所有内容,并希望它再次起作用。
最后我的评论/问题是:
client-side version doesn't match the server-side
错误出现时,为什么我们不能获得有关[[有什么不同的详细信息?]