Skip to content

TypeError: Cannot read property 'length' of undefined #345

Closed
@justin808

Description

@justin808

Reproduces here: shakacode/react-webpack-rails-tutorial#163

Here's the stack dump:

> eslint --ext .js,.jsx . "." "--ext" ".jsx,.js"

/Users/justin/shakacode/react-webpack-rails-tutorial/client/node_modules/eslint-plugin-react/lib/rules/prop-types.js:403
        for (var i = 0, j = node.id.properties.length; i < j; i++) {
                                              ^

TypeError: Cannot read property 'length' of undefined
    at markPropTypesAsUsed (/Users/justin/shakacode/react-webpack-rails-tutorial/client/node_modules/eslint-plugin-react/lib/rules/prop-types.js:403:47)
    at EventEmitter.VariableDeclarator (/Users/justin/shakacode/react-webpack-rails-tutorial/client/node_modules/eslint-plugin-react/lib/rules/prop-types.js:577:7)
    at emitOne (events.js:82:20)
    at EventEmitter.emit (events.js:169:7)
    at NodeEventGenerator.enterNode (/Users/justin/shakacode/react-webpack-rails-tutorial/client/node_modules/eslint/lib/util/node-event-generator.js:42:22)
    at CommentEventGenerator.enterNode (/Users/justin/shakacode/react-webpack-rails-tutorial/client/node_modules/eslint/lib/util/comment-event-generator.js:98:23)
    at Controller.controller.traverse.enter (/Users/justin/shakacode/react-webpack-rails-tutorial/client/node_modules/eslint/lib/eslint.js:767:36)
    at Controller.__execute (/Users/justin/shakacode/react-webpack-rails-tutorial/client/node_modules/estraverse/estraverse.js:397:31)
    at Controller.traverse (/Users/justin/shakacode/react-webpack-rails-tutorial/client/node_modules/estraverse/estraverse.js:495:28)
    at EventEmitter.module.exports.api.verify (/Users/justin/shakacode/react-webpack-rails-tutorial/client/node_modules/eslint/lib/eslint.js:764:24)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions