Eslint-plugin-import: 2.19.1 - Cannot read property 'value' of null

Created on 9 Dec 2019  路  11Comments  路  Source: benmosher/eslint-plugin-import

Description

eslint broken after update
But it works with the older version 2.18.2.
Cannot read property 'value' of null TypeError: Cannot read property 'value' of null at ExportNamedDeclaration (/node_modules/eslint-plugin-import/lib/rules/no-extraneous-dependencies.js:210:71) 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.enterNode (/node_modules/eslint/lib/util/node-event-generator.js:294:14) at CodePathAnalyzer.enterNode (/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:608:23) at Traverser.enter [as _enter] (/node_modules/eslint/lib/linter.js:865:28) at Traverser._traverse (/node_modules/eslint/lib/util/traverser.js:132:14)

bug help wanted

All 11 comments

Any idea what code this is warning on?

1049 / cc @marcusdarmstrong

1436 / cc @schmidsi

Assuredly my changes. I'll have a PR up momentarily.

Oh, I'm sorry, I was totally out of the loop here: Seems like you already fixed my awfully broken assumption in 2.19.1.

@marcusdarmstrong in one of the 4 visitors yes - but it's still causing issues, hence this OP :-)

Basically, the same fix probably needs to go on all 4, but I want a failing test case that covers all bugfixes first, and that's what I'm hoping you can help with.

Happy to add a testcase for the ExportNamedDeclaration case, but the others should be safe, per spec, as it's the only node type of the four with a nullable source: https://github.com/estree/estree/blob/master/es2015.md#exportnameddeclaration

I added a test case here that covers the fix here, but that's included in v2.19.1, and this issue is happening in v2.19.1 :-/

Can't say I can really see a codepath for that鈥攖he dereference is immediately following the check. Do we have a reproduction on 2.19.1?

Indeed, eslint-plugin-import/lib/rules/no-extraneous-dependencies.js:210 in the release version of 2.19.1 corresponds to the if statement鈥擶hereas it would refer to the rereference in 2.19.0. So I'd expect this is a misreporting on the version?

@Alex-Verevkine can you confirm that you're using v2.19.0, or v2.19.1? Closing for now, but will reopen if v2.19.1 is confirmed.

Was this page helpful?
0 / 5 - 0 ratings