-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a recipe to transpile async functions #579
Conversation
Add a minimal babel configuration example to transpile async functions.
|
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/devongovett/website/retohtwust |
], | ||
"plugins": [ | ||
["@babel/plugin-transform-runtime", { | ||
"regenerator": true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are those lines for ? I think it is not required for @babel/preset-env
to work well.
By the way I think it is related to this error parcel-bundler/parcel#2936 ? I've faced it too and can't find a way to fix it... is it the solution ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @benavern, sorry for the delay.
It is to be able to transpile properly async functions.
Without it, I get this error in the console :
ReferenceError: regeneratorRuntime is not defined
And obviously the code does not work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok. I have struggled with this error too but not with async functions. If I remember well this is when using a bundle (generated by parcel) as a dependancy in a project that uses parcel too.
And I don't have any async function in it.
If you wonna help on it: https://github.com/benavern/z-components
I really like this but unfortunately we're having issues with deploying the v1 site, so I'm gonna close this for now as we're mainly focusing on v2 and the docs site for that version and it doesn't seem like we'll be able to fix the deploy... |
Add a minimal babel configuration example to transpile async functions.