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 'name' of undefined at getPropName #1881

Closed
pumpkin123 opened this issue Jul 6, 2018 · 2 comments
Closed

Cannot read property 'name' of undefined at getPropName #1881

pumpkin123 opened this issue Jul 6, 2018 · 2 comments

Comments

@pumpkin123
Copy link

env:
"eslint": "^5.0.0",
"eslint-plugin-react": "^7.10.0",

I got a error when use eslint --ext .js src;
the error is happened in eslint-plugin-react\lib\rules\jsx-props-no-multi-spaces.js getPropName function, this function like can't handle the Node type, and I console the Node type, there is

{ type: 'JSXMemberExpression', start: 1243, end: 1252, loc: SourceLocation { start: Position { line: 43, column: 9 }, end: Position { line: 43, column: 18 } }, range: [ 1243, 1252 ], object: Node { type: 'JSXIdentifier', start: 1243, end: 1247, loc: SourceLocation { start: [Object], end: [Object] }, range: [ 1243, 1247 ], name: 'Menu', _babelType: 'JSXIdentifier', parent: [Circular] }, property: Node { type: 'JSXIdentifier', start: 1248, end: 1252, loc: SourceLocation { start: [Object], end: [Object] }, range: [ 1248, 1252 ], name: 'Item', _babelType: 'JSXIdentifier', parent: [Circular] }, _babelType: 'JSXMemberExpression', parent: Node { type: 'JSXOpeningElement', start: 1242, end: 1269, loc: SourceLocation { start: [Object], end: [Object] }, range: [ 1242, 1269 ], attributes: [ [Object] ], name: [Circular], selfClosing: false, _babelType: 'JSXOpeningElement', parent: Node { type: 'JSXElement', start: 1242, end: 1325, loc: [Object], range: [Array], openingElement: [Circular], closingElement: [Object], children: [Array], _babelType: 'JSXElement', parent: [Object] } } }
@ljharb
Copy link
Member

ljharb commented Jul 6, 2018

Can you share the code that it crashes on?

@yoyo837
Copy link
Contributor

yoyo837 commented Jul 16, 2018

Same issue. Also see eslint/eslint#10610

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants