"The prop value with an expression type of AssignmentExpression could not be resolved."

See original GitHub issue

Error trace:

The prop value with an expression type of AssignmentExpression could not be resolved.
  Please file issue to get this fixed immediately.
Error: The prop value with an expression type of AssignmentExpression could not be resolved.
  Please file issue to get this fixed immediately.
    at extract (jsx-ast-utils\lib\values\expressions\index.js:175:11)
    at Object.extractValueFromLogicalExpression [as LogicalExpression] (jsx-ast-utils\lib\values\expressions\LogicalExpression.js:28:38)
    at Object.extract [as JSXExpressionContainer] (jsx-ast-utils\lib\values\expressions\index.js:178:21)
    at getValue (jsx-ast-utils\lib\values\index.js:48:27)
    at extractValue (jsx-ast-utils\lib\getPropValue.js:24:12)
    at getPropValue (jsx-ast-utils\lib\getPropValue.js:41:10)
    at eslint-plugin-jsx-a11y\lib\rules\no-static-element-interactions.js:79:95
    at Array.some (native)
    at EventEmitter.JSXOpeningElement (eslint-plugin-jsx-a11y\lib\rules\no-static-element-interactions.js:75:52)

After stepping through I’ve found the culprit in the onClick assignment here:

this._options.map((config, key) => <DropdownBox.Item key={key}
    onClick={this._cachedOnClickItemHandlers[key] ||
        (this._cachedOnClickItemHandlers[key] = this._onClickItem.bind(null, config))}>
  {config.label}
</DropdownBox.Item>)

Yeah, not the nicest code, but I guess this shouldn’t break eslint

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
jessebeachcommented, Jul 1, 2019

Absolutely yes. The throw - and the logging - are just the feedback mechanism for how we do that.

That makes sense. I hadn’t thought about it that way. Thanks for reopening them.

0reactions
fo-focommented, Mar 15, 2020

Also happens with +=, e.g.:

let bar = 0;
<div foo={bar += 1} />

I found something like this in our codebase that was causing this message. It turned out to be a minor bug (was supposed to be +).

Would it be possible to display the file/line where the error happened when this error is logged?

Read more comments on GitHub >

github_iconTop Results From Across the Web

The prop value with an expression type of ... - GitHub
"The prop value with an expression type of SequenceExpression could not be resolved. Please file issue to get this fixed immediately." .
Read more >
I am getting this error: The prop value with an expression type ...
I am getting this error: The prop value with an expression type of Chain Expression could not be resolved. Please file is Failed...
Read more >
jsx-ast-utils | Yarn - Package Manager
Returns the JSXAttribute itself or undefined, indicating the prop is not present on the ... to expression types to handle recursively extracting prop...
Read more >
Expressions - C# language specification - Microsoft Learn
The assignment operator itself (=) cannot be overloaded. An assignment always performs a simple store of a value into a variable (§11.19.2).
Read more >
Top 5 babel-traverse Code Examples - Snyk
i}`) // get prop-types if (cPath.isExpressionStatement() && node.expression.type === 'AssignmentExpression') { let leftNode = node.expression.left if ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found