在我的nuxt应用程序中,在使用this.$router.push({ path: '/path' })改变路由后,我在火狐中获得了nodeOps.tagName(...) is undefined,在chrome中我得到了cannot get access to .toLowerCase() of undefined。
它发生在createPatchFunction of vue.runtime.esm.js版本:nuxt:^2.14.12, vue:^2.6.12中。
function createPatchFunction (backend) {
// ...
// some more vue framework code here
// ...
function emptyNodeAt (elm) {
// the following line throws error and app crashes
return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
}
}更新:-- elm参数是html注释类型。
更新-2: package.json和nuxt.config.js文件:
{
"name": "name",
"version": "1.0.0",
"scripts": {
"build": "nuxt build",
"test": "jest",
"dev": "nuxt",
"generate": "nuxt generate",
"start": "nuxt start"
},
"dependencies": {
"@chenfengyuan/vue-number-input": "^1.2.1",
"@nuxt/content": "^1.5.0",
"@nuxtjs/axios": "^5.12.4",
"@nuxtjs/gtm": "^2.4.0",
"@nuxtjs/proxy": "^2.1.0",
"nuxt": "^2.14.12",
"vue": "^2.6.12",
"vue-multiselect": "^2.1.6",
"vue-numeric-input": "^1.0.6",
"vuex-pathify": "^1.4.4"
},
"devDependencies": {
"@babel/core": "7.12.17",
"@babel/preset-env": "7.12.17",
"@nuxtjs/style-resources": "^1.0.0",
"@nuxtjs/svg": "^0.1.12",
"@nuxtjs/vuetify": "^1.11.2",
"@vue/cli-plugin-unit-jest": "^4.5.13",
"@vue/test-utils": "^1.2.2",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^27.0.6",
"eslint": "^7.25.0",
"eslint-plugin-vue": "^7.9.0",
"jest": "^27.0.6",
"vue-jest": "^3.0.7",
"vue-svg-loader": "^0.16.0",
"vue-template-compiler": "^2.6.12"
}
}nuxt.config.js
import colors from "vuetify/es5/util/colors";
export default {
mode: "universal",
target: "static",
css: ["@/assets/scss/global.scss"],
plugins: [
"~/plugins/api/index.js",
"~/plugins/sassVaribles/index.js",
"~/plugins/datePicker/index.client.js",
"~/plugins/globalComponents.js",
],
components: false,
buildModules: ["@nuxtjs/vuetify", "@nuxtjs/style-resources"],
modules: [
"@nuxtjs/axios",
"@nuxt/content",
"@nuxtjs/svg",
"@nuxtjs/proxy"
],
styleResources: {
scss: ["@/assets/scss/main.scss"]
},
env: {
},
server: {
port: 8089,
host: "0.0.0.0"
},
axios: {
baseURL: ""
},
vuetify: {
customVariables: ["~/assets/variables.scss"],
rtl: false,
theme: {
dark: false,
default: "light",
disable: false,
options: {
customProperties: true,
variations: true
},
themes: {
light: {
primary: "#5050a0",
accent: colors.grey.darken3,
secondary: colors.amber.darken3,
info: "#dddcec",
warning: colors.amber.base,
error: colors.deepOrange.accent4,
success: colors.green.accent3
},
dark: {
primary: colors.blue.darken2,
accent: colors.grey.darken3,
secondary: colors.amber.darken3,
info: colors.teal.lighten1,
warning: colors.amber.base,
error: colors.deepOrange.accent4,
success: colors.green.accent3
},
custom: {
color: {
background: {
default: "#fff",
paper: "#fff",
paperOverlay: "#fff"
},
text: {
primary: "#000",
secondary: "rgba(0, 0, 0, 0.7)",
disabled: "rgba(0, 0, 0, 0.5)",
hint: "rgba(0, 0, 0, 0.5)",
icon: "rgba(0, 0, 0, 0.5)"
}
}
}
}
}
},
};发布于 2022-03-02 09:02:05
获得Nuxt error : nodeOps.tagName(...)和以下vm undefined错误:[Vue warn]: Error in render: "TypeError: _vm is undefined" (found in )
在我的组件中用v-if替换了v-show之后,它得到了解决,在组件中,我一直在提取服务器端的异步数据,并使用vuex getter(状态也修改了服务器端)来修改模板。
发布于 2021-08-25 12:24:30
看起来你有一个老版本的Node?https://github.com/nuxt/nuxt.js/issues/2385#issuecomment-358111543
尝试升级到最新的LTS,又名14,并再次检查您是否得到了最新版本的Nuxt。
https://stackoverflow.com/questions/68917917
复制相似问题