Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

8.0.0 breaks certain requires #179

Closed
kylecordes opened this issue Mar 11, 2017 · 2 comments
Closed

8.0.0 breaks certain requires #179

kylecordes opened this issue Mar 11, 2017 · 2 comments

Comments

@kylecordes
Copy link

kylecordes commented Mar 11, 2017

(Apologies, as I write this I only have a couple of minutes so I'm including a very non-minimal reproduction of a problem. If it turns out to be hard to reproduce, next week I can work on a minimal reproduction. Please ask, or even just close this issue if the non-minimal repro is too much of a problem! But I thought it useful to have the issue in to at least help anyone else affected.)

The following repo uses rollup-plugin-commonjs 7.0.0, and works:

https://github.com/OasisDigital/angular-aot-es2015-rollup/tree/rollup-plugin-commonjs-179

npm install; ./aot-build.sh

But with rollup-plugin-commonjs is changed to 8.0.0, it fails with the following:

node_modules/core-js/modules/_shared-key.js (7:4)
5: 
6: var shared = require$$0('keys')
7:   , ;
       ^
8: var _sharedKey = function(key){
9:   return shared[key] || (shared[key] = uid(key));

I think either Buble or Uglify is objecting to the syntax, and perhaps should instead accept it - but this syntax only appears with 8.0.0, and I saw there's recently been a change to the code handling rewriting of requires.

c8c2548

... so there is some chance that @Rich-Harris will simply see my snippet above and know what caused it.

Rich-Harris added a commit that referenced this issue Mar 11, 2017
remove declarators within a var declaration correctly
@Rich-Harris
Copy link
Contributor

Thanks! Fixed in 8.0.1

@kylecordes
Copy link
Author

I thank you for the fix, and promise not to sin again with an overly large repro repo. At least not very often...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants