import 引入对象出现undefined
以下操作确定目录没有问题
//api/user.js
步骤1
import Http from '@api/base/http';
console.log(Http) //undefined
步骤2
import Http from '@api/a/http';
console.log(Http) //正常
步骤3
//重新运行 npm start
import Http from '@api/a/http';
console.log(Http) //undefined
//出现undefined时浏览器输出的错误信息
Uncaught TypeError: Super expression must either be null or a function, not undefined
at exports.default (inherits.js?3dfd:21)
at eval (user.js?9c35:6) //api/user.js
at eval (user.js?9c35:6)
at Object../src/api/user.js (app.js:2829)
at __webpack_require__ (app.js:708)
at fn (app.js:113)
at eval (user.js?7719:1)
at Object../src/stores/model/user.js (app.js:3173)
at __webpack_require__ (app.js:708)
at fn (app.js:113)
造成这个报错是因为引入冲突导致的。
大致排查是:
在我的store模块中引入了api模块;
而在api模块中引入了store;