Vue项目踩坑之TypeError: Cannot read properties of undefined (reading 'xxx')

1,309 阅读1分钟
Uncaught TypeError: Cannot read properties of undefined (reading 'use')
at eval (webpack-internal:///./src/router/index.js:17:41)
at Module../src/router/index.js (app.js:1471:1)
at **webpack_require** (app.js:849:30)
at fn (app.js:151:20)
at eval (webpack-internal:///./src/main.js:12:74)
at Module../src/main.js (app.js:1315:1)
at **webpack_require** (app.js:849:30)
at fn (app.js:151:20)
at Object.1 (app.js:1484:18)
at **webpack_require** (app.js:849:30)

我在网上搜了很多关于这个错误的原因:

  1. 版本错误
  2. 数据定义错误
  3. 路径错误

我错的非常离谱,因为之前的另一个报错尝试改了代码import { Vue } from 'vue' 没有改回去,就出现这个错误,改回import Vue from 'vue' 就好了