Eslint-plugin-react: Error in 7.12.3 Cannot read property 'split' of undefined

Created on 11 Jan 2019  路  4Comments  路  Source: yannickcr/eslint-plugin-react

error:

TypeError: Cannot read property 'split' of undefined
    at Object.isPropWrapperFunction (/Users/sinapinto/src/ui-admin/node_modules/eslint-plugin-react/lib/util/propWrapper.js:12:26)
    at resolveNodeValue (/Users/sinapinto/src/ui-admin/node_modules/eslint-plugin-react/lib/util/defaultProps.js:29:23)
    at Object.MemberExpression (/Users/sinapinto/src/ui-admin/node_modules/eslint-plugin-react/lib/util/defaultProps.js:124:28)
    at updatedRuleInstructions.(anonymous function) (/Users/sinapinto/src/ui-admin/node_modules/eslint-plugin-react/lib/util/Components.js:754:46)
    at listeners.(anonymous function).forEach.listener (/Users/sinapinto/src/ui-admin/node_modules/eslint/lib/util/safe-emitter.js:45:58)
    at Array.forEach (<anonymous>)
    at Object.emit (/Users/sinapinto/src/ui-admin/node_modules/eslint/lib/util/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/Users/sinapinto/src/ui-admin/node_modules/eslint/lib/util/node-event-generator.js:251:26)
    at NodeEventGenerator.applySelectors (/Users/sinapinto/src/ui-admin/node_modules/eslint/lib/util/node-event-generator.js:280:22)
    at NodeEventGenerator.enterNode (/Users/sinapinto/src/ui-admin/node_modules/eslint/lib/util/node-event-generator.js:294:14)

minimum to reproduce:

import React from 'react';
import PropTypes from 'prop-types';

export default class Foo extends React.Component {
    render() {
        return null;
    }
}

Foo.defaultProps = Object.assign({});

eslint config:

'use strict';

module.exports = {
    parser: 'babel-eslint',
    plugins: ['import', 'react'],
    settings: {
        react: {
            version: '16.2',
        },
    },
    parserOptions: {
        ecmaFeatures: {
            jsx: true,
        },
    },
    env: {
        browser: true,
        es6: true,
    },
    rules: {
        'react/no-unused-prop-types': ['error'],
    },
};

versions:
eslint: 5.12.0
eslint-plugin-react: 7.12.3
npm: 6.5.0

bug help wanted

Most helpful comment

When will this item be included in a new release? This is currently breaking my application, looking forward for a new release 7.12.4 with this fix included!

All 4 comments

When will this item be included in a new release? This is currently breaking my application, looking forward for a new release 7.12.4 with this fix included!

I also need this, please release 7.12.4 ASAP. Thanks!

Just chiming in to say that I also need this ASAP.

v7.12.4 has been released.

Was this page helpful?
0 / 5 - 0 ratings