Skip to content

Why does Babel transpile async functions to generators via _asyncToGenerator if target supports async/await? #13912

Answered by JLHwung
nlucero asked this question in Q&A
Discussion options

You must be logged in to vote

Can you update browserslists to the latest version? The browserslists comes with a node-releases package which tells browserslists the currently known node versions.

My guess here is that if node v14 works for you, then the node-releases may be out-of-dated and browserslists thinks that node >= 16.0.0 is unknown node versions, which causes Babel fallbacks to applying all transforms.

You can also add debug: true to the preset-env options, which will print the resolved browsers targets.

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by nlucero
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants