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
element.addExportedVariables is not a function #2750
Comments
Hi @MichaelRando, thanks for the issue. Even though a proper repro would be better, the stack trace already looks very helpful. Will do some poking around array patterns to see if I can identify the issue. |
Ok, so initial poking did not reveal anything yet, but maybe we can find the culprit together. There is a special logic for SystemJS that eventually helps us to update exported variables in pattern assignments which is apparently faulty. Basically what this stack trace tells me that there is something that can legally be a part of array patterns that I overlooked (or are you using any special acorn plugins to allow advanced syntax?). More precisely, the culprit appears to be something like ([someVariable] = someOtherVariable); but with something substantially different inside the pattern on the left side that I apparently overlooked. It could also be nested: someFunctionCall([someVariable] = someOtherVariable); Maybe if you search for something like |
Actually it was not too difficult to patch the code. Could you try
and try to bundle your code to SystemJS? It should now output some additional information before the error occurs. |
So, I've done what I could to investigate the repro; and I've lost it. My two hypotheses are that either 1. my build setup had an abnormality that cleared up upon a reset or 2. The code I was compiling that day had some errors that were expressed by that callstack, but were not committed to revision control and so going back to that hash and retracing my steps does not yield the same result. I'm building the codebase with 'esm' and 'system' without errors since Friday against 1.6, this issue should be put away. |
Thanks for checking anyway. If it pops up again, just open another issue. I like to treat Rollup crashes with high priority! |
Sure thing. As mentioned above, could you try npm install rollup/rollup#gh-2750-debug-array-pattern try to bundle your code to SystemJS and paste what is logged to the console? |
It is a an array destructuring assignment to an ElementAccessExpression on an identifier that causes the issue |
I can honestly say that after years of JavaScript, I learned something fundamentally new today. Thanks for digging into this. Fix at #2760. |
Wow, that was incredibly fast. Thanks so much for this |
How Do We Reproduce?
I don't have a repro case yet, all I did was take my project output format from 'iife' and tried 'system'. It worked okay for small subset of files; but when I tried to compile my main file I got:
I don't have much to go on here; I was wondering if there are flags I could pass on the command line that would tell us more about which file or plugin is failing here, or if any maintainers wanted to guide my hands to reducing this down to a minimal repro.
The text was updated successfully, but these errors were encountered: