Classes & Generators: Can't combine?
See original GitHub issueIf you are reporting a bug, please fill in below. Otherwise feel free to remove this template entirely.
Can you reproduce the problem with latest npm?
Yes.
Description
When a script with both a js class and a generator are defined, compilation breaks.
Expected behavior
Compilation of script.
Actual behavior
Browser console logs error message “…Uncaught ReferenceError: _regeneratorRuntime is not defined”
Environment
npm ls react-scripts
:
my-app@0.1.0 /Users/angelbeltran/dev/test/my-app
└── react-scripts@0.9.5
node -v
:
v7.0.0
npm -v
:
4.5.0
- Operating system: MacOS Sierra, Version 10.12.4
- Browser and version: Google Chrome, 57.0.2987.133 (64-bit)
Reproducible Demo
https://github.com/angelbeltran/my-test-app
I added a simple class and generator to src/index.js. Clone and enter the project, and run
npm start
When the browser opens, you’ll get the error message I got.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Joining two DirectoryIterators in Keras - Stack Overflow
Just combine the generators in another generator, optionally with different augmentation configs: idg1 = ImageDataGenerator(**idg1_configs) ...
Read more >Why do we not combine random number generators?
I cannot find examples of anyone combining two or more families of generators with the usual xor operator. If there is sufficient computer...
Read more >How to merge two DirectoryIterator? · Issue #9969 - GitHub
My question is whether it's possible to merge\combine train_generator with validation_generator to a single generator that contains images ...
Read more >Generator problems resolved. - YouTube
Fixing The Cheapest Generator, starts but won't stay running. · HOW TO REDUCE FUEL CONSUMPTION ON GENERATORS · Harbor freight generator wont start....
Read more >Generators - The Modern JavaScript Tutorial
In a regular function, to combine results from multiple other functions, we call them, store the results, and then join at the end....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I could reproduce using
react-scripts@0.9.5
with the same sample code provided by @angelbeltran. However I could not reproduce on latest master commit (5ecda24f76a0d64aba98f3f5059e25e1a9695ce6) usingnpm start
.Edit: Sorry didn’t see your post @gaearon
This does not reproduce in master. I’m assuming it was fixed by disabling CommonJS transform.