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

Cannot read property 'node' of undefined in no-danger-with-children.js #921

Closed
priyajeet opened this issue Oct 19, 2016 · 0 comments
Closed
Labels

Comments

@priyajeet
Copy link

priyajeet commented Oct 19, 2016

[email protected]
[email protected]
[email protected]

Cannot read property 'node' of undefined
TypeError: Cannot read property 'node' of undefined
    at /Users/phora/console/node_modules/eslint-plugin-react/lib/rules/no-danger-with-children.js:59:43
    at Array.find (native)
    at findJsxProp (/Users/phora/console/node_modules/eslint-plugin-react/lib/rules/no-danger-with-children.js:56:25)
    at EventEmitter.JSXElement (/Users/phora/console/node_modules/eslint-plugin-react/lib/rules/no-danger-with-children.js:80:14)
    at emitOne (events.js:77:13)
    at EventEmitter.emit (events.js:169:7)
    at NodeEventGenerator.enterNode (/Users/phora/console/node_modules/eslint/lib/util/node-event-generator.js:40:22)
    at CodePathAnalyzer.enterNode (/Users/phora/console/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:608:23)
    at CommentEventGenerator.enterNode (/Users/phora/console/node_modules/eslint/lib/util/comment-event-generator.js:97:23)
    at Controller.enter (/Users/phora/console/node_modules/eslint/lib/eslint.js:898:36)

In my code, likely pooping on

<IntlProvider {...__I18N__}>

where I18N is a webpack global defined by the define plugin

plugins: [
            new DefinePlugin({
                __I18N__: JSON.stringify({
                    locale,
                    messages
                }),
                ...
            })
        ]

.eslintrc whitelists it as a global, I guess the plugin should use that and assume its there...workaround is just assigning that global to a local and using that instead.

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