问题出在哪里:Uncaught ReferenceError: require is not defined

时间:2021-05-18 10:42:35

标签: node.js

Uncaught ReferenceError: require is not defined
    at Object.url (:4200/main.js:18799)
    at __webpack_require__ (:4200/runtime.js:80)
    at Object../node_modules/webpack-dev-server/client/utils/createSocketUrl.js (:4200/vendor.js:174760)
    at __webpack_require__ (:4200/runtime.js:80)
    at Object.<anonymous> (:4200/vendor.js:174394)
    at Object../node_modules/webpack-dev-server/client/index.js?http://0.0.0.0:0/sockjs-node&sockPath=/sockjs-node (:4200/vendor.js:174551)
    at __webpack_require__ (:4200/runtime.js:80)
    at Object.0 (:4200/main.js:18753)
    at __webpack_require__ (:4200/runtime.js:80)
    at checkDeferredModules (:4200/runtime.js:46)

我在控制台中发现了这个错误,特别是在这里

module.exports = require("url");

这是一个 Webpack 错误吗?

0 个答案:

没有答案