Error when using generator functions
See original GitHub issueCurrent 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:
- Created 4 years ago
- Comments:9
Top 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 >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 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
Automatic pure polyfilling of generators with
babel-plugin-polyfill-regenerator
fortargets
that need a polyfill has been added in #795 and will be released in v0.14.0 soon.