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

Components.js throws on component #364

Closed
tmcw opened this issue Dec 18, 2015 · 2 comments
Closed

Components.js throws on component #364

tmcw opened this issue Dec 18, 2015 · 2 comments
Labels

Comments

@tmcw
Copy link
Contributor

tmcw commented Dec 18, 2015

/home/ubuntu/studio/node_modules/eslint-plugin-react/lib/util/Components.js:296
        if (!node.properties) {
                 ^

TypeError: Cannot read property 'properties' of undefined
    at Object.utils.getRelatedComponent (/home/ubuntu/studio/node_modules/eslint-plugin-react/lib/util/Components.js:296:18)
    at EventEmitter.MemberExpression (/home/ubuntu/studio/node_modules/eslint-plugin-react/lib/rules/display-name.js:134:29)
    at emitOne (events.js:82:20)
    at EventEmitter.emit (events.js:169:7)
    at NodeEventGenerator.enterNode (/home/ubuntu/studio/node_modules/eslint/lib/util/node-event-generator.js:42:22)
    at CommentEventGenerator.enterNode (/home/ubuntu/studio/node_modules/eslint/lib/util/comment-event-generator.js:98:23)
    at Controller.controller.traverse.enter (/home/ubuntu/studio/node_modules/eslint/lib/eslint.js:767:36)
    at Controller.__execute (/home/ubuntu/studio/node_modules/eslint/node_modules/estraverse/estraverse.js:397:31)
    at Controller.traverse (/home/ubuntu/studio/node_modules/eslint/node_modules/estraverse/estraverse.js:495:28)
    at EventEmitter.module.exports.api.verify (/home/ubuntu/studio/node_modules/eslint/lib/eslint.js:764:24)

Unfortunately I can't associate this with a specific input yet because it's only occurring on a CI server, but this is using eslint-plugin-react 3.11.3 and babel-eslint 5.0.0-beta6.

@tmcw
Copy link
Contributor Author

tmcw commented Dec 18, 2015

This was caused by something like:

        <div className={`strong fill-lighten0 pad1 contain small icon ${typeLabel[type].icon}`}>
          {typeLabel[type].displayName}
       </div>

Pretty sure having an object with a displayName property is confusing eslint-plugin-react.

@yannickcr
Copy link
Member

I was not able to reproduce the crash, but I added an additional check that should prevent this case.

Don't hesitate to reopen this issue if your problem is not resolved.

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

2 participants