日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

nuxt 打包后運行 DOMException: Failed to execute ‘appendChild‘ on ‘Node‘: This node(已解決)

作者:lllomh 更新時間: 2022-02-28 編程語言

開發環境有這個錯誤的話:不影響使用:不管的話?

一般在開發環境下,日志會有

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.

但是不影響使用,而且一般都是在刷新當前頁面的時候才會報這個警告。但是一旦build發布到線上就會發生

DOMException: Failed to execute 'appendChild' on 'Node': This node type does not support this method

的問題。

我的解決方案是,直接在疑似產生The client-side rendered virtual DOM tree is not matching server-rendered content問題的代碼上包裹一層<client-only>標簽,直接不讓后臺渲染這部分代碼就解決這個問題了

原文鏈接:https://blog.csdn.net/lllomh/article/details/123072753

欄目分類
最近更新