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.

Error when using generator functions

See original GitHub issue

Current Behavior

after add some code with generator, it generates some code which lead to

Uncaught ReferenceError: regeneratorRuntime is not defined

I tried to solve it with https://github.com/microsoft/TypeScript-Babel-Starter/issues/26#issuecomment-437652709, but it gave me other error:

(babel plugin) Error: Runtime helpers are not enabled. Either exclude the transform-runtime Babel plugin or pass the `runtimeHelpers: true` option. See https://github.com/rollup/rollup-plugin-babel#configuring-babel for more information

Your environment

Software Version(s)
TSDX 0.12.3
TypeScript 3.8.2
Browser chrome
npm/Yarn yarn 1.21.1
Node 12.14.1
Operating System mac

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
devanfarrellcommented, Mar 10, 2020

I didn’t realize this was supposed to be supported. Here is my babel config I’ve also been using as a work around. https://github.com/devanfarrell/redux-dogma/blob/master/.babelrc

0reactions
agilgur5commented, Sep 20, 2020

Automatic pure polyfilling of generators with babel-plugin-polyfill-regenerator for targets that need a polyfill has been added in #795 and will be released in v0.14.0 soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript error when using generator function - Stack Overflow
Your generator function spits out strings, returns nothing and never uses values which generator accepts via next – therefore it's type ...
Read more >
Generator.prototype.throw() - JavaScript - MDN Web Docs
The throw() method of a generator acts as if a throw statement is inserted in the generator's body at the current suspended position,...
Read more >
How to throw an error in an async generator function in ...
In this article, we will try to understand how to throw an error in a synchronous (abbreviated as “async”) generator function in JavaScript...
Read more >
Why would anyone need JavaScript generator functions?
This pop() function reveals a weakness of generators (and iterators in general). The weakness is that they are mutable. Popping one item from ......
Read more >
"There is a problem with Generator" occurs when launching ...
Error : "There is a problem with Generator" occurs when launching ... occur when launching Photoshop or using Generator-related functions.
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