首页 > 解决方案 > 无法读取未定义的属性“类型”| 编译失败 - ReactApp

问题描述

当我尝试编译我的 React 应用程序时,我收到了这条消息:

在此处输入图像描述

我试图更新 npm,安装我能安装的一切,但它仍然无法正常工作......

就在那里,我的错误代码:

Uncaught Error: Module build failed: TypeError: Cannot read property 'type' of undefined
at isForInRef (:3000/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint/lib/rules/no-unused-vars.js:406)
at variable.references.some.ref (:3000/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint/lib/rules/no-unused-vars.js:443)
at Array.some (<anonymous>)
at isUsedVariable (:3000/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint/lib/rules/no-unused-vars.js:442)
at collectUnusedVariables (:3000/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint/lib/rules/no-unused-vars.js:565)
at collectUnusedVariables (:3000/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint/lib/rules/no-unused-vars.js:572)
at Program:exit (:3000/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint/lib/rules/no-unused-vars.js:617)
at listeners.(:3000/anonymous function).forEach.listener (/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint/lib/util/safe-emitter.js:47:58)
at Array.forEach (<anonymous>)
at Object.emit (:3000/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint/lib/util/safe-emitter.js:47)
at NodeEventGenerator.applySelector (:3000/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint/lib/util/node-event-generator.js:251)
at NodeEventGenerator.applySelectors (:3000/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint/lib/util/node-event-generator.js:280)
at NodeEventGenerator.leaveNode (:3000/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint/lib/util/node-event-generator.js:303)
at CodePathAnalyzer.leaveNode (:3000/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:630)
at CodePathAnalyzer.overrideLeaveNode (:3000/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint-plugin-node/lib/rules/process-exit-as-throw.js:127)
at Traverser.leave [as _leave] (:3000/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint/lib/linter.js:868)
at isForInRef (:3000/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint/lib/rules/no-unused-vars.js:406)
at variable.references.some.ref (:3000/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint/lib/rules/no-unused-vars.js:443)
at Array.some (<anonymous>)
at isUsedVariable (:3000/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint/lib/rules/no-unused-vars.js:442)
at collectUnusedVariables (:3000/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint/lib/rules/no-unused-vars.js:565)
at collectUnusedVariables (:3000/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint/lib/rules/no-unused-vars.js:572)
at Program:exit (:3000/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint/lib/rules/no-unused-vars.js:617)
at listeners.(:3000/anonymous function).forEach.listener (/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint/lib/util/safe-emitter.js:47:58)
at Array.forEach (<anonymous>)
at Object.emit (:3000/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint/lib/util/safe-emitter.js:47)
at NodeEventGenerator.applySelector (:3000/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint/lib/util/node-event-generator.js:251)
at NodeEventGenerator.applySelectors (:3000/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint/lib/util/node-event-generator.js:280)
at NodeEventGenerator.leaveNode (:3000/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint/lib/util/node-event-generator.js:303)
at CodePathAnalyzer.leaveNode (:3000/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:630)
at CodePathAnalyzer.overrideLeaveNode (:3000/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint-plugin-node/lib/rules/process-exit-as-throw.js:127)
at Traverser.leave [as _leave] (:3000/Users/lucasgoncalves/GitHub Local/C-D-localhost/Client/node_modules/eslint/lib/linter.js:868)
at Object../src/layouts/popup.js (index.js:8)
at __webpack_require__ (bootstrap 67fb8c2d093d03f17433:678)
at fn (bootstrap 67fb8c2d093d03f17433:88)
at Object../src/pages/main.page.js (login.page.js:9)
at __webpack_require__ (bootstrap 67fb8c2d093d03f17433:678)
at fn (bootstrap 67fb8c2d093d03f17433:88)
at Object../src/App.js (fetch.js:461)
at __webpack_require__ (bootstrap 67fb8c2d093d03f17433:678)
at fn (bootstrap 67fb8c2d093d03f17433:88)
at Object../src/index.js (index.css?f255:26)
at __webpack_require__ (bootstrap 67fb8c2d093d03f17433:678)
at fn (bootstrap 67fb8c2d093d03f17433:88)
at Object.0 (store.js:215)
at __webpack_require__ (bootstrap 67fb8c2d093d03f17433:678)
at bootstrap 67fb8c2d093d03f17433:724
at bootstrap 67fb8c2d093d03f17433:724

我检查了我在 Stack 上找到的所有内容,但找不到可以帮助我解决此问题的主题...

感谢您的帮助,如果这种主题已经存在,我很抱歉,我之前找不到它:/

标签: reactjswebpackreact-routerbabeljsbabel-loader

解决方案


推荐阅读