我的源代码是:
import Vue from "vue";
console.log('Vue', Vue)
有了这个包版本:
"@vue/cli": "4.5.15",
"@vue/cli-plugin-babel": "^5.0.1",
"@vue/cli-service": "4.5.15",
"@vue/compiler-sfc": "^3.2.31",
"@vue/component-compiler-utils": "^3.1.2",
但当我将app.js文件挂载到html时,它显示了一个错误。
Uncaught TypeError: Cannot convert undefined or null to object
at hasOwn (<anonymous>)
at t.exports (well-known-symbol.js:16:26)
at Object.c04e (to-primitive.js:10:20)
at a (bootstrap:79:22)
at Object.a04b (to-property-key.js:1:19)
at a (bootstrap:79:22)
at Object.06cf (object-get-own-property-descriptor.js:6:21)
at a (bootstrap:79:22)
at Object.23e7 (export.js:2:32)
at a (bootstrap:79:22)
可能是ES版本或其他什么的问题,idk如何在谷歌上搜索,请帮助提出任何建议
我已经从更改了我的package.json
"vuex": "^4.0.2",
"vue-cli": "^2.9.6",
"@vue/cli": "4.5.15",
"vue-loader": "^16.0.0-beta.8",
"vue-router": "^4.0.13",
"@vue/cli-plugin-babel": "^5.0.1",
"@vue/cli-service": "4.5.15",
"@vue/compiler-sfc": "^3.2.31",
至
"vue": "2.6.*",
"vue-template-compiler": "^2.0.0",
"webpack-cli": "^4.9.2",
"webpack-dev-middleware": "^5.3.1",
"@vue/cli": "^5.0.1",
"@vue/cli-plugin-babel": "^5.0.1",
"@vue/cli-service": "^5.0.1",
"babel-loader": "^8.2.3",
应用程序在没有出现此错误的情况下运行。