在执行npm run dev时出现_vueRouter2.default is not a constructor
Uncaught TypeError: _vueRouter2.default is not a constructor
at Object.eval (eval at <anonymous> (build.js:1195), <anonymous>:64:14)
at eval (eval at <anonymous> (build.js:1195), <anonymous>:93:30)
at Object.<anonymous> (build.js:1195)
at __webpack_require__ (build.js:654)
at fn (build.js:84)
at Object.<anonymous> (build.js:1989)
at __webpack_require__ (build.js:654)
at build.js:701
at build.js:704
请问各位大神这会是什么原因呢?
我的问题已经解决了,你看一下你的是不是也是这个原因。
在webpack配置文件webpack.config.js文件中,config={}里面有一个参数是resolve:
这里缺少vue-router,加进去即可。