You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: Error while loading rule 'react/prefer-stateless-function': Cannot read properties of null (reading 'version')
Occurred while linting D:\project\src_site\pages\HomePage.js
at getReactVersionFromContext (D:\project\node_modules\eslint-plugin-react\lib\util\version.js:92:81)
at testReactVersion (D:\project\node_modules\eslint-plugin-react\lib\util\version.js:138:28)
at usedPropTypesInstructions (D:\project\node_modules\eslint-plugin-react\lib\util\usedPropTypes.js:285:36)
at Function.componentRule (D:\project\node_modules\eslint-plugin-react\lib\util\Components.js:1018:37)
at createRuleListeners (D:\project\node_modules\eslint\lib\linter\linter.js:915:21)
at D:\project\node_modules\eslint\lib\linter\linter.js:1097:31
at Array.forEach ()
at runRules (D:\project\node_modules\eslint\lib\linter\linter.js:1034:34)
at Linter._verifyWithoutProcessors (D:\project\node_modules\eslint\lib\linter\linter.js:1382:31)
at Linter._verifyWithConfigArray (D:\project\node_modules\eslint\lib\linter\linter.js:1722:21)
The text was updated successfully, but these errors were encountered:
Actually, the issue is that "latest" is an invalid value. It supports a semver version range, or "detect". "latest" is not a semver range, it's just an npm tag.
I'll try to improve the error message here, and avoid a crash, but you'll still need to fix your eslint config.
Hi!
I found a bug, please take a look, thanks!
npx eslint src_site/pages/HomePage.js
Oops! Something went wrong! :(
ESLint: 8.8.0
TypeError: Error while loading rule 'react/prefer-stateless-function': Cannot read properties of null (reading 'version')
Occurred while linting D:\project\src_site\pages\HomePage.js
at getReactVersionFromContext (D:\project\node_modules\eslint-plugin-react\lib\util\version.js:92:81)
at testReactVersion (D:\project\node_modules\eslint-plugin-react\lib\util\version.js:138:28)
at usedPropTypesInstructions (D:\project\node_modules\eslint-plugin-react\lib\util\usedPropTypes.js:285:36)
at Function.componentRule (D:\project\node_modules\eslint-plugin-react\lib\util\Components.js:1018:37)
at createRuleListeners (D:\project\node_modules\eslint\lib\linter\linter.js:915:21)
at D:\project\node_modules\eslint\lib\linter\linter.js:1097:31
at Array.forEach ()
at runRules (D:\project\node_modules\eslint\lib\linter\linter.js:1034:34)
at Linter._verifyWithoutProcessors (D:\project\node_modules\eslint\lib\linter\linter.js:1382:31)
at Linter._verifyWithConfigArray (D:\project\node_modules\eslint\lib\linter\linter.js:1722:21)
The text was updated successfully, but these errors were encountered: