This seems to happen when
Minimal repro:
export const Foo = ({ Component }) => {
React.useEffect(() => {
console.log(<Component />);
}, []);
};
"eslint-plugin-react-hooks": "^4.1.1",
Interestingly, this does NOT cause the error:
export const Foo = ({ component }) => {
React.useEffect(() => {
const Component = component;
console.log(<Component />);
}, []);
};
I might be the same.
It happens when @typescript-eslint/parser is 4.1.0 and I ran yarn eslint.
yarn run v1.22.4
$ eslint ./src --ext .js,.jsx,.ts,.tsx
The prop value with an expression type of ChainExpression could not be resolved. Please file issue to get this fixed immediately.
Oops! Something went wrong! :(
ESLint: 7.8.1
TypeError: Cannot read property 'parent' of null
I think the issue of typescript-eslint is related.
fastFindReferenceWithParent in eslint-plugin-react-hooks returns null...
Confirmed with @typescript-eslint/parser 4.x. Interestingly by fixing it we can implement https://github.com/facebook/react/issues/18051 for @typescript-eslint/parser@^4.0. I'll follow-up with a PR. We might need to partition the tests by parser and not language.
Fix in [email protected].
@eps1lon Thank you for solving this.
I'm still seeing this
The prop value with an expression type of ChainExpression could not be resolved. Please file issue to get this fixed immediately.
The prop value with an expression type of ChainExpression could not be resolved. Please file issue to get this fixed immediately.
The prop value with an expression type of ChainExpression could not be resolved. Please file issue to get this fixed immediately.
The prop value with an expression type of ChainExpression could not be resolved. Please file issue to get this fixed immediately.
The prop value with an expression type of ChainExpression could not be resolved. Please file issue to get this fixed immediately.
with the latest dependencies
[email protected],
@typescript-eslint/parser": "^4.2.0,
@typescript-eslint/eslint-plugin": "^4.2.0"
eslint": "^7.9.0"
Unfortunately it doesn't show me which line of code/ components are causing this to error.
And the build continues fine..
Same as @damiangreen here.
You should probably create a new issue.
@travigd I don't think so, since it's the same error
A new issue is likely to be seen by the relevant people more easily since it's not closed. And at least the error I reported in the issue above was actually fixed, even if it's the same error message.
@travigd Makes sense! I'll create another issue for it
@LauraBeatris did you make the issue? if so can you mention it in this thread. as this is the top Google result..
@damiangreen Just created https://github.com/facebook/react/issues/19940
Most helpful comment
I'm still seeing this
with the latest dependencies
[email protected],@typescript-eslint/parser": "^4.2.0,@typescript-eslint/eslint-plugin": "^4.2.0"eslint": "^7.9.0"Unfortunately it doesn't show me which line of code/ components are causing this to error.
And the build continues fine..