Feature request: Improved error `async arrow functions are unsupported`
Problem
async arrow functions (ignored by Babel) trigger Hermes error
https://github.com/facebook/hermes/blob/4ab9f178caf6f0d47df0e0778bec5d1bf394f5c6/lib/IRGen/ESTreeIRGen-func.cpp#L215
causing ./gradlew :app:installRelease to fail
after Metro finishes bundling
Solution
it would be great if Hermes would output instead
async arrow functions are unsupported
Additional Context
- https://github.com/facebook/hermes/issues/1208
The good news is that we will be releasing a beta version of Hermes supporting most ES6+ features in 2024 Q1, so at that time none of these plugins will be necessary.
- https://github.com/facebook/hermes/issues/1389
nb: i think Static Hermes will be supporting arrow functions too
That is a good point. So, basically we need to make the error message more specific. Can you please submit a PR for this?
Has anyone figured out how to configure support for async arrow functions using plug-ins, in the meantime? Would really love to know how to do this.
@kleydon yes: https://github.com/ExodusMovement/test/blob/6e928e7267eb5ef19d316e0b09b81d49553bfd8f/bundler/bundle.js#L57-L63 + rest is in esbuild config in the same file
FWIW, async arrows are implemented in SH
@ChALkeR , @fbmal7 - thanks!