-
Notifications
You must be signed in to change notification settings - Fork 363
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
regeneratorRuntime is not defined when using generator #708
Comments
This is a bug. I think it should be fixed by #707. To clarify - are you using |
Thanks for the quick response.
I am trying to move https://github.com/vega/vega over to microbundle and mainly target browsers. I ran into the problem above because of https://github.com/vega/vega/blob/a8e6991411c2c5c4805320f87276e9861e80d69c/packages/vega-statistics/src/numbers.js#L1.
We do have a babel config in the repo (although I will probably get rid of it once I have switched over to microbundle). I was able to reproduce the issue without any special files (just the code above). |
So yeah, my issue is similar to #704 but I am not targeting node. |
Alrighty. I need to double-check my fix there for the browser target. |
Sweet. Thanks! |
@domoritz @developit Same error for me, there is a fix now? |
I created my own rollup config: https://github.com/vega/vega/blob/master/rollup.config.js. |
Fixed in 0.13. Please re-open if this is not working still. |
This is happening for me in 0.13.0 |
Still have this error :( there's a patch for this behaviour? |
Hmm - do you have a custom Babel configuration by chance? Microbundle should be generating code that targets Node 12+, which should never use Regenerator since generators are fully supported. |
@developit I'm running into the same issue with the latest version, without having any custom Babel configuration. Steps to reproduce:
In the output files ( |
@YousefED your package.json has a |
Ah thanks, I think that originated from React defaults from a different project. In any case, when I remove that from package.json, I still have the same issue. |
@developit Not sure if you've seen my comment / would you prefer me to open a new issue? Let me know if there's any other way I help diagnose (or some hints to debug the issue myself) |
running
Results in this error
It works if I add
import 'regenerator-runtime/runtime';
to the top of the js file but it would be great if I didn't have to guess that this extra import is required (and it won't be required in the modern build for example:node dist/out.modern.js
works).The text was updated successfully, but these errors were encountered: