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

TypeError: Cannot read property 'properties' of undefined @ Object.utils.getRelatedComponent #383

Closed
hfwang opened this issue Jan 6, 2016 · 1 comment
Labels

Comments

@hfwang
Copy link

hfwang commented Jan 6, 2016

I'm getting this when I run eslint:

/path_to_code/node_modules/eslint-plugin-react/lib/util/Components.js:298
        if (!node.properties) {
                 ^

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

Things seem reasonable if I change that line to instead be if (!node || !node.properties) { but that's a pretty dirty hack.

@hfwang
Copy link
Author

hfwang commented Jan 6, 2016

I get this error with the following JSX file:

export default const Foo = {}
Foo.Bar = class extends React.Component {
}
Foo.Bar.propTypes = {};

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