"Cannot read property 'type' of undefined" after upgrading to 4.14.0
See original GitHub issueGot the error after upgrading to 4.14.0 on Flow type definitions
TypeError: Cannot read property 'type' of undefined
TypeError: Cannot read property 'type' of undefined
at isForInRef (..\node_modules\eslint\lib\rules\no-unused-vars.js:410:24)
at variable.references.some.ref (..\node_modules\eslint\lib\rules\no-unused-vars.js:447:21)
at Array.some (<anonymous>)
at isUsedVariable (..\node_modules\eslint\lib\rules\no-unused-vars.js:446:40)
at collectUnusedVariables (..\node_modules\eslint\lib\rules\no-unused-vars.js:569:26)
at collectUnusedVariables (..\node_modules\eslint\lib\rules\no-unused-vars.js:576:17)
at Program:exit (..\node_modules\eslint\lib\rules\no-unused-vars.js:621:36)
at listeners.(anonymous function).forEach.listener (..\node_modules\eslint\lib\util\safe-emitter.js:47:58)
at Array.forEach (<anonymous>)
at Object.emit (..\node_modules\eslint\lib\util\safe-emitter.js:47:38)
at NodeEventGenerator.applySelector (..\node_modules\eslint\lib\util\node-event-generator.js:251:26)
at NodeEventGenerator.applySelectors (..\node_modules\eslint\lib\util\node-event-generator.js:280:22)
at NodeEventGenerator.leaveNode (..\node_modules\eslint\lib\util\node-event-generator.js:303:14)
at CodePathAnalyzer.leaveNode (..\node_modules\eslint\lib\code-path-analysis\code-path-analyzer.js:630:23)
at CodePathAnalyzer.overrideLeaveNode (..\node_modules\eslint-plugin-node\lib\rules\process-exit-as-throw.js:127:27)
at Traverser.leave [as _leave] (..\node_modules\eslint\lib\linter.js:1000:32)
Process finished with exit code -1
Issue Analytics
- State:
- Created 6 years ago
- Reactions:43
- Comments:14 (6 by maintainers)
Top Results From Across the Web
Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError : Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >Uncaught TypeError: Cannot read properties of undefined ...
I got a similar error scratched my head for hours and later on realized that I was using useEffect inside my component and...
Read more >Cannot read property 'type' of undefined Occurred while linting ...
最后在“Cannot read property 'type' of undefined” after upgrading to 4.14.0 #9767 找到了一个解决方法. 将 "babel-eslint": "^7.2.3", ...
Read more >How to Prevent the Error: Cannot Read Property '0' of Undefined
A guide on how to prevent the error "cannot Read Property '0' of Undefined", covering techniques such as try, catch, using const over...
Read more >When running server: "TypeError: Cannot read property 'types ...
... local ~you are now globally limited~ [gltd-server] Listening on 2657 TypeError: Cannot read property 'types' of undefined at Function.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I apology for the inconvenience. We have found a bug in
babel-eslint’s new logic that I added. It does not work correctly if it falls back to monkeypatching once (If you are using a plugin which parses some files (e.g. imported files) withbabel-eslint, it can fall back).We have published
babel-eslint@8.1.1to fix this. Please try it.Further reading: babel/babel-eslint#558, babel/babel-eslint#559.
Thanks It’s solved the problem!