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

Error in 7.8.0 Cannot read property 'split' of undefined #1785

Closed
bdwain opened this issue May 11, 2018 · 17 comments
Closed

Error in 7.8.0 Cannot read property 'split' of undefined #1785

bdwain opened this issue May 11, 2018 · 17 comments
Labels

Comments

@bdwain
Copy link

bdwain commented May 11, 2018

Cannot read property 'split' of undefined
TypeError: Cannot read property 'split' of undefined
at test (....node_modules/eslint-plugin-react/lib/util/version.js:30:25)
at Object.testReactVersion (...node_modules/eslint-plugin-react/lib/util/version.js:39:10)

My eslint version is "4.19.1"
My node version is 9.11.1

@jsg2021
Copy link
Contributor

jsg2021 commented May 11, 2018

Same with node 10.0.0 & eslint 4.19.1

@omarchehab98
Copy link

omarchehab98 commented May 11, 2018

Same with node version 7 and node version 8 and eslint 4.19.1

@ghost
Copy link

ghost commented May 11, 2018

Same w/ Node LTS, eslint@4.19.1, and npm@6.0.0

@ljharb
Copy link
Member

ljharb commented May 11, 2018

Can anyone affected by this share their eslint config, and also more of the stack trace?

@taddei
Copy link

taddei commented May 11, 2018

I think I found something. Might open a PR soon

@ljharb
Copy link
Member

ljharb commented May 11, 2018

@taddei I have a fix already, I just need a regression test.

@taddei
Copy link

taddei commented May 11, 2018

ok cool, np.
feel free to discard this: #1786

@taddei
Copy link

taddei commented May 11, 2018

the hotfix is just a patch though. I noticed that it's trying to see if the method constructor is deprecated, should probably skip core class methods like this one?

@ljharb
Copy link
Member

ljharb commented May 11, 2018

aha, thanks, that did it :-)

ljharb added a commit to taddei/eslint-plugin-react that referenced this issue May 11, 2018
@ljharb ljharb added the bug label May 11, 2018
@bdwain
Copy link
Author

bdwain commented May 12, 2018

thanks for fixing this so quickly!

@fcastilloec
Copy link

I'm still seeing this error when using eslint-plugin-react v7.8.2 with eslint v4.19.1, it supposed to have been fixed with v7.8.1. Here's the output I see:

[Error - 17:34:55] ESLint stack trace:
[Error - 17:34:55] TypeError: Cannot read property 'split' of undefined
    at test (.../node_modules/eslint-plugin-react/lib/util/version.js:30:24)
    at Object.testReactVersion (.../node_modules/eslint-plugin-react/lib/util/version.js:39:10)
    at isDeprecated (.../node_modules/eslint-plugin-react/lib/rules/no-deprecated.js:104:21)
    at checkDeprecation (.../node_modules/eslint-plugin-react/lib/rules/no-deprecated.js:109:12)
    at methods.forEach.method (.../node_modules/eslint-plugin-react/lib/rules/no-deprecated.js:162:35)
    at Array.forEach (native)
    at Object.checkLifeCycleMethods (.../node_modules/eslint-plugin-react/lib/rules/no-deprecated.js:162:17)
    at updatedRuleInstructions.(anonymous function) (.../node_modules/eslint-plugin-react/lib/util/Components.js:698:75)
    at listeners.(anonymous function).forEach.listener (.../node_modules/eslint/lib/util/safe-emitter.js:47:58)
    at Array.forEach (native)

@jethrolarson

This comment has been minimized.

@ljharb

This comment has been minimized.

@jethrolarson

This comment has been minimized.

@DylanVann
Copy link

This bug is in 7.12.3. Issue should be re-opened.

@ljharb
Copy link
Member

ljharb commented Jan 11, 2019

@DylanVann instead, a new issue should be filed - but luckily #2131 was filed and fixed already, and will be included in the next release.

@DylanVann
Copy link

@ljharb Awesome, and it has a test too 😄 . Thank you for letting me know

fly0305 pushed a commit to fly0305/react-tag that referenced this issue Aug 13, 2022
* chore(package): update eslint-plugin-react to 7.9.1 which solves the issue jsx-eslint/eslint-plugin-react#1785

* chore(package): Add babel-eslint as parser for eslint

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

No branches or pull requests

8 participants