Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'type' of null #3220

Closed
amiramix opened this issue Feb 25, 2022 · 2 comments
Closed

TypeError: Cannot read property 'type' of null #3220

amiramix opened this issue Feb 25, 2022 · 2 comments

Comments

@amiramix
Copy link

amiramix commented Feb 25, 2022

Linting this file:

// testrule.jsx
const trackLink = () => {};
const getAnalyticsUiElement = () => {};

const onTextButtonClick = (e, item) => trackLink([, getAnalyticsUiElement(item), item.name], e);

Throws the following error:

Oops! Something went wrong! :(

ESLint: 8.9.0

TypeError: Cannot read property 'type' of null
Occurred while linting /Users/g/work/raptor-ui/packages/rcom-raptor-ui_article/src/components/testrule.jsx:4
Rule: "react/jsx-key"
    at /Users/g/work/raptor-ui/node_modules/eslint-plugin-react/lib/rules/jsx-key.js:111:110
    at Array.filter (<anonymous>)
    at ArrayExpression, JSXElement > JSXElement (/Users/g/work/raptor-ui/node_modules/eslint-plugin-react/lib/rules/jsx-key.js:111:94)
    at ruleErrorHandler (/Users/g/work/raptor-ui/node_modules/eslint/lib/linter/linter.js:1107:28)
    at /Users/g/work/raptor-ui/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (/Users/g/work/raptor-ui/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/Users/g/work/raptor-ui/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
    at NodeEventGenerator.applySelectors (/Users/g/work/raptor-ui/node_modules/eslint/lib/linter/node-event-generator.js:326:22)
    at NodeEventGenerator.enterNode (/Users/g/work/raptor-ui/node_modules/eslint/lib/linter/node-event-generator.js:340:14)

Using the following deps:

    "@babel/core": "7.17.4",
    "@babel/eslint-parser": "7.17.0",
    "eslint": "8.9.0",
    "eslint-plugin-cypress": "^2.12.1",
    "eslint-plugin-import": "^2.25.4",
    "eslint-plugin-jest": "^26.1.1",
    "eslint-plugin-json": "^3.1.0",
    "eslint-plugin-jsx-a11y": "^6.5.1",
    "eslint-plugin-react": "^7.28.0",
    "eslint-plugin-react-hooks": "^4.3.0",
  }

This worked in version 7.28.0 so seems to be broken in the new version released today 7.29.0

@ljharb
Copy link
Member

ljharb commented Feb 25, 2022

Thanks, fix incoming!

@ljharb ljharb closed this as completed in a5dc2a2 Feb 25, 2022
@ljharb
Copy link
Member

ljharb commented Feb 25, 2022

v7.29.1 is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants