question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Classes & Generators: Can't combine?

See original GitHub issue

If 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

  1. Operating system: MacOS Sierra, Version 10.12.4
  2. 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:closed
  • Created 6 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ianschmitzcommented, May 15, 2017

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) using npm start.

Edit: Sorry didn’t see your post @gaearon

1reaction
gaearoncommented, May 15, 2017

This does not reproduce in master. I’m assuming it was fixed by disabling CommonJS transform.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found