Error with array destructuring assignment #358
Comments
I get the same error at the following line: [this.queryBegin, this.queryEnd] = this.callback(graph) |
Same type of error but do not know the origin: [!] (commonjs plugin) TypeError: extractors[element.type] is not a function
node_modules/@babel/parser/lib/index.js
TypeError: extractors[element.type] is not a function
at /home/markus/build/npm-template-sync/node_modules/rollup-plugin-commonjs/src/ast-utils.js:53:41
at Array.forEach (<anonymous>)
at Object.ArrayPattern (/home/markus/build/npm-template-sync/node_modules/rollup-plugin-commonjs/src/ast-utils.js:52:17)
at extractNames (/home/markus/build/npm-template-sync/node_modules/rollup-plugin-commonjs/src/ast-utils.js:36:23)
at Object.enter (/home/markus/build/npm-template-sync/node_modules/rollup-plugin-commonjs/src/transform.js:158:4)
at visit (/home/markus/build/npm-template-sync/node_modules/estree-walker/src/estree-walker.js:22:9)
at visit (/home/markus/build/npm-template-sync/node_modules/estree-walker/src/estree-walker.js:44:4)
at visit (/home/markus/build/npm-template-sync/node_modules/estree-walker/src/estree-walker.js:39:5)
at visit (/home/markus/build/npm-template-sync/node_modules/estree-walker/src/estree-walker.js:44:4)
at visit (/home/markus/build/npm-template-sync/node_modules/estree-walker/src/estree-walker.js:44:4)
|
I'm also getting this error. I'm refactoring a node lib which had a lot of babel dependencies.. weird thing I only started getting .the error when I removed the babel dependencies. Even after reinstalling them, I still get it. "devDependencies": { |
This solved it for me.
I still don't know the root cause, perhaps a bug in commonJs plugin, but ignoring babel prevents the error at least for now. |
This is probably a relatively straightforward change to the parse code to handle this additional case. Has anyone attempted a fix yet? |
Also a new test case is added to `misc tests -> misc tests`
Pretty sure array destructuring assignments should work with array dereferences, but I get a
TypeError
.The text was updated successfully, but these errors were encountered: