nuxt项目Failed to execute 'appendChild' on 'Node'

花生 可爱的博主

时间: 2021-06-01 阅读: 71 字数:1040

{}

问题: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>标签, 直接不让后台渲染这部分代码就解决这个问题了

本文章网址:https://www.sjxi.cn/detil/6109c05b49234e11b4a3221baac69fb5

最新评论

当前未登陆哦
登陆后才可评论哦

湘ICP备2021009447号