问题:nuxt项目刷新出现:“Error while initializing app DOMException: Failed to execute 'appendChild' on 'Node': This node type does not support this method.”
“Error while initializing app DOMException: Failed to execute 'appendChild' on 'Node': This node type does not support this method.”
这个问题是在项目部署之后出现的!
开发环境下,日志会有
warning: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.
解决方法
直接在疑似产生The client-side rendered virtual DOM tree is not matching server-rendered content问题的代码上包裹一层<client-only>标签,
直接不让后台渲染这部分代码就解决这个问题了





评论
登录后即可评论
分享你的想法,与作者互动
暂无评论