problem description
the problem occurs during the period of packaging using webpack, and it runs without any problems. After that, all components defined at the time of packaging will throw
.TypeError: Cannot read property "vue" of undefined
The same is true ofincluding App.vue. Components are imported through vue-router and displayed through routing rules, and imported routing objects are mounted in the main function main. Each component is then imported into different components according to different requirements and then mounted.
the environmental background of the problems and what methods you have tried
related codes
components all throw this kind of problem
ERROR in ./src/App.vue
Module build failed (from ./node_modules/_vue-loader@13.5.0@vue-loader/index.js):
TypeError: Cannot read property "vue" of undefined
at Object.module.exports (D:\WebStormDoor\Vue_vide\14\node_modules\_vue-
loader@13.5.0@vue-loader\lib\loader.js:57:18)
@ ./src/main.js 43:11-31
what result do you expect? What is the error message actually seen?
I don"t quite understand why there is no problem at run time and why there is an error when compiling and packaging