javascript - nuxt js "Failed to execute ' appendChild' on 'Node' : This node type does not support this method"on mobile view port

标签 javascript vue.js vuetify.js nuxt.js

尝试运行我的 nuxtjs 时发现此错误带有 vuetify 的应用程序在移动视口(viewport)上,但一切都在桌面视口(viewport)上运行良好。

本地机器上的错误 image : error on local machine :
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.
使用 ubuntu 和 nginx 运行我的 nuxtjs 应用程序的服务器上的错误 pm2使用yarn build然后 pm2 start yarn -- start image : error on server
DOMException: Failed to execute 'appendChild' on 'Node': This node type does not support this method.
这两个错误都发生在同一场景中。

当我在桌面视口(viewport)上运行它时,然后切换到移动视口(viewport)(不重新加载页面)它运行良好。但是如果我在移动视口(viewport)上重新加载它,就会发生这些错误。

不确定我应该分享哪个页面,因为即使在 nuxt+vuetify 默认主页上,所有页面都会发生此错误。

目前在桌面视口(viewport)上也会出现同样的错误,但是通过将我的组件包装在 <client-only></client-only> 中来修复它,并且错误从桌面视口(viewport)消失,但仍然发生在移动视口(viewport)上。

最佳答案

检查您是否在使用 v-if指示
尝试将其更改为 v-show因为v-show呈现 HTML 并将 display 属性设置为 true 或 false,而 v-if不渲染(真正的 conditional rendering )。
就我而言,我有 v-if在我的模板中的一些节点上并将其替换为 v-show将元素保留在 DOM 中并帮助丢失这样的节点错误。

关于javascript - nuxt js "Failed to execute ' appendChild' on 'Node' : This node type does not support this method"on mobile view port,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62124873/

相关文章:

php - *.php 文件上的 Adob​​e Air Javascript

javascript - Jquery.append() 在类选择器的某个位置

javascript - 如何在Vue中传递函数参数以使用axios发出GET请求?

javascript - 如何将值传递给子组件 vue 和循环?

vue.js - 数据表: Pagination Arrows & Row Select Box Not Displayed

javascript - 在Vue组件中使用.scss颜色变量

在 Vuetify Stepper 内部时,Handsontable 不会立即显示

javascript - example.com 中的 setcookie(),在 www.example.com 中找不到 cookie

javascript - $.each 不适用于 jquery 选择器?

laravel - 为什么我总是需要运行 npm run production 来查看更改