You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.
Do you guys have an option on how to deal with the regeneratorRuntime is not defined issue?
I updates your index.ts and added the following method into the C class:
asyncmetodo(){return"ok";}
After building it and trying to invoke the transpiled code using node ./lib/index I got the following error:
$ node
> require("./lib/index")
ReferenceError: regeneratorRuntime is not defined
at /Users/adilson/dev/TypeScript-Babel-Starter/lib/index.js:46:7
at /Users/adilson/dev/TypeScript-Babel-Starter/lib/index.js:64:6
>
That's because of this part of the generated code that requires regeneratorRuntime to work:
to add @babel/polyfill that actually works but it is a terrible option when coding a new lib as there is no central import point, making the require to happen on each file
Do you have any tips on that?
Thanks!
The text was updated successfully, but these errors were encountered:
Please let me know does it fix your issue with regeneratorRuntime is not defined. I will upload a small working webpack solution to github if necessary.
Does babel always transform async/await statements to regeneratorRuntime calls? If so — should this be added to the recommended setup in the README, given that async/await is a core part of typescript?
Hi there.
Do you guys have an option on how to deal with the
regeneratorRuntime is not defined
issue?I updates your
index.ts
and added the following method into the C class:After building it and trying to invoke the transpiled code using
node ./lib/index
I got the following error:That's because of this part of the generated code that requires
regeneratorRuntime
to work:All the post I saw so far mention those two options:
@babel/plugin-transform-regenerator which I could not manage to get it working
to add
@babel/polyfill
that actually works but it is a terrible option when coding a new lib as there is no central import point, making the require to happen on each fileDo you have any tips on that?
Thanks!
The text was updated successfully, but these errors were encountered: