vue项目在运行时报错,无法打开主页

报错信息如下:

external "querystring"?71da:1 Uncaught ReferenceError: require is not defined

at eval (external "querystring"?71da:1)
at Object.<anonymous> (app.js:2401)
at __webpack_require__ (app.js:621)
at fn (app.js:47)
at Object.eval (client.js?7955:17)
at eval (266:280)
at Object.<anonymous> (app.js:2377)
at __webpack_require__ (app.js:621)
at fn (app.js:47)
at eval (dev-client.js?7d67:3)

控制台信息如下:

clipboard.png

阅读 6.4k
1 个回答

控制台不是让你看issues嘛。。。

1.更新依赖包,这是原话,如果你不知道这个警告是什么,你可以忽视它,它会随着时间消失。

If you have no clue what this is all about, you can safely ignore the deprecation warning. It will disappear over time if you keep your packages up-to-date.

2.在 webpack.config.js 加上 process.traceDeprecation = true,不过你得找到哪个 loader 出现这个警告的

If you're a webpack user who is using another loader, you can set process.traceDeprecation = true in your webpack.config.js to find out which loader is causing this deprecation warning.

loader-utils Issues#56

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题