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

The prop value with an expression type of BindExpression could not be resolved. Please file issue to get this fixed immediately. #33

Closed
vivaxy opened this issue Apr 25, 2017 · 8 comments

Comments

@vivaxy
Copy link

vivaxy commented Apr 25, 2017

From evcohen/eslint-plugin-jsx-a11y, I got an error when running eslint-plugin-jsx-a11y plugin which uses jsx-ast-utils.

Here is my configuration:

OS: macOS 10.12.4
Running ESLint: v3.19.0
Launched with: eslint command line
Stacktrace:

> ./node_modules/.bin/eslint ./src
The prop value with an expression type of BindExpression could not be resolved.
  Please file issue to get this fixed immediately.
Error: The prop value with an expression type of BindExpression could not be resolved.
  Please file issue to get this fixed immediately.
    at extract (/Users/vivaxy/Developer/react-ui/node_modules/jsx-ast-utils/lib/values/expressions/index.js:173:11)
    at Object.extractValueFromCallExpression [as CallExpression] (/Users/vivaxy/Developer/react-ui/node_modules/jsx-ast-utils/lib/values/expressions/CallExpression.js:24:30)
    at extract (/Users/vivaxy/Developer/react-ui/node_modules/jsx-ast-utils/lib/values/expressions/index.js:176:21)
    at Object.extractValueFromLogicalExpression [as LogicalExpression] (/Users/vivaxy/Developer/react-ui/node_modules/jsx-ast-utils/lib/values/expressions/LogicalExpression.js:27:37)
    at Object.extract [as JSXExpressionContainer] (/Users/vivaxy/Developer/react-ui/node_modules/jsx-ast-utils/lib/values/expressions/index.js:176:21)
    at getValue (/Users/vivaxy/Developer/react-ui/node_modules/jsx-ast-utils/lib/values/index.js:48:27)
    at extractValue (/Users/vivaxy/Developer/react-ui/node_modules/jsx-ast-utils/lib/getPropValue.js:24:12)
    at getPropValue (/Users/vivaxy/Developer/react-ui/node_modules/jsx-ast-utils/lib/getPropValue.js:41:10)
    at /Users/vivaxy/Developer/react-ui/node_modules/eslint-plugin-jsx-a11y/lib/rules/href-no-hash.js:47:48
    at Array.map (native)
@ljharb
Copy link
Member

ljharb commented Apr 25, 2017

Any chance you could narrow this down to the exact code that it breaks on?

@beefancohen
Copy link
Contributor

beefancohen commented Apr 25, 2017

@ljharb that's okay, we don't have any BindExpression parser in this repo. It would be for the following:

::this.foo 
::console.log

getPropValue would return "this.foo.bind(this)" and "console.log.bind(console)"
getLiteralPropValue would return null

I started a branch to work on a fix, but need to update to use babylon for tests instead of acorn-jsx, which wasn't as simple as I had hoped.

@tsheaff
Copy link

tsheaff commented May 19, 2017

@evcohen any update on this? Or a workaround. I'm getting the same error:

The prop value with an expression type of BindExpression could not be resolved.
  Please file issue to get this fixed immediately.
Error: The prop value with an expression type of BindExpression could not be resolved.
  Please file issue to get this fixed immediately.
    at Object.extract [as JSXExpressionContainer] (/Users/tsheaff/Code/private/calm/www/node_modules/jsx-ast-utils/lib/values/expressions/index.js:173:11)
    at getValue (/Users/tsheaff/Code/private/calm/www/node_modules/jsx-ast-utils/lib/values/index.js:48:27)
    at extractValue (/Users/tsheaff/Code/private/calm/www/node_modules/jsx-ast-utils/lib/getPropValue.js:24:12)
    at getPropValue (/Users/tsheaff/Code/private/calm/www/node_modules/jsx-ast-utils/lib/getPropValue.js:41:10)
    at /Users/tsheaff/Code/private/calm/www/node_modules/eslint-plugin-jsx-a11y/lib/rules/no-static-element-interactions.js:76:95
    at Array.some (native)
    at EventEmitter.JSXOpeningElement (/Users/tsheaff/Code/private/calm/www/node_modules/eslint-plugin-jsx-a11y/lib/rules/no-static-element-interactions.js:75:52)
    at emitOne (events.js:101:20)
    at EventEmitter.emit (events.js:191:7)
    at NodeEventGenerator.applySelector (/Users/tsheaff/Code/private/calm/www/node_modules/eslint/lib/util/node-event-generator.js:265:26)
    at NodeEventGenerator.applySelectors (/Users/tsheaff/Code/private/calm/www/node_modules/eslint/lib/util/node-event-generator.js:294:22)

It fails for any file that includes the :: syntax.

@Pines-Cheng
Copy link

any update on this?

@beefancohen
Copy link
Contributor

#43 is the outstanding PR

@TrejGun
Copy link

TrejGun commented Aug 3, 2017

please fix this

1 similar comment
@netfishx
Copy link

netfishx commented Aug 4, 2017

please fix this

@beefancohen
Copy link
Contributor

v2.0.1 released with this patch

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

7 participants