vacuumlabs/babel-plugin-extensible-destructuring

Cannot read property 'name' of undefined

wataru358 opened this issue · 6 comments

Hi,
Using 4.2.0 with babel-core@6.26.0 gave us following issue on our webpack build.
Noticed when I do clean npm install yesterday.
Using 4.1.0 won't cause any issue.
Any insight on this...?

webpack build error
`
ERROR in ./src/utils/xxxx.js
Module build failed: TypeError: /Users/myuser/myproject/src/utils/myreactcomponent.js: Cannot read property 'name' of undefined
at DestructuringTransformer.pushObjectProperty (/Users/myuser/myproject/node_modules/babel-plugin-extensible-destructuring/lib/index.js:209:96)
at DestructuringTransformer.pushObjectPattern (/Users/myuser/myproject/node_modules/babel-plugin-extensible-destructuring/lib/index.js:251:18)
at DestructuringTransformer.push (/Users/myuser/myproject/node_modules/babel-plugin-extensible-destructuring/lib/index.js:156:16)
at DestructuringTransformer.init (/Users/myuser/myproject/node_modules/babel-plugin-extensible-destructuring/lib/index.js:417:14)
at PluginPass.VariableDeclaration (/Users/myuser/myproject/node_modules/babel-plugin-extensible-destructuring/lib/index.js:639:27)
at newFn (/Users/myuser/myproject/node_modules/babel-traverse/lib/visitors.js:276:21)
at NodePath._call (/Users/myuser/myproject/node_modules/babel-traverse/lib/path/context.js:76:18)
at NodePath.call (/Users/myuser/myproject/node_modules/babel-traverse/lib/path/context.js:48:17)
at NodePath.visit (/Users/myuser/myproject/node_modules/babel-traverse/lib/path/context.js:105:12)
at TraversalContext.visitQueue (/Users/myuser/myproject/node_modules/babel-traverse/lib/context.js:150:16)
at TraversalContext.visitMultiple (/Users/myuser/myproject/node_modules/babel-traverse/lib/context.js:103:17)
at TraversalContext.visit (/Users/myuser/myproject/node_modules/babel-traverse/lib/context.js:190:19)
at Function.traverse.node (/Users/myuser/myproject/node_modules/babel-traverse/lib/index.js:114:17)
at NodePath.visit (/Users/myuser/myproject/node_modules/babel-traverse/lib/path/context.js:115:19)
at TraversalContext.visitQueue (/Users/myuser/myproject/node_modules/babel-traverse/lib/context.js:150:16)
at TraversalContext.visitSingle (/Users/myuser/myproject/node_modules/babel-traverse/lib/context.js:108:19)
at TraversalContext.visit (/Users/myuser/myproject/node_modules/babel-traverse/lib/context.js:192:19)
at Function.traverse.node (/Users/myuser/myproject/node_modules/babel-traverse/lib/index.js:114:17)
...

`

Facing the same error on a new create-react-app project. Haven't yet found anything to add to the discussion though.

Thank you folks, seems related to #22

Aye, it is. Sorry about the long hiatus, hopefully I didn't ruin all y'all workdays. I have posted a new PR, #26 , that looks at the version number instead of testing for existence of the deprecated function. The problem being it's still there and just throwing stack traces.

I've managed to build my own project (3k+ modules) with both Webpack 3/Babel 6, and Webpack 4/Babel 7.

Just a sidenote, this plugin replaces babel/plugin-transform-destructuring, the two should probably not be used at the same time.

Again, sorry about last time.

@wataru358 Has this been resolved by the latest version?

@palnes Workes like a charm. Thank you.

This should probably be closed. :)