hermes icon indicating copy to clipboard operation
hermes copied to clipboard

Feature request: Improved error `async arrow functions are unsupported`

Open leotm opened this issue 1 year ago • 5 comments

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

leotm avatar May 07 '24 11:05 leotm

That is a good point. So, basically we need to make the error message more specific. Can you please submit a PR for this?

tmikov avatar May 07 '24 22:05 tmikov

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 avatar Aug 11 '24 21:08 kleydon

@kleydon yes: https://github.com/ExodusMovement/test/blob/6e928e7267eb5ef19d316e0b09b81d49553bfd8f/bundler/bundle.js#L57-L63 + rest is in esbuild config in the same file

ChALkeR avatar Sep 11 '24 20:09 ChALkeR

FWIW, async arrows are implemented in SH

fbmal7 avatar Sep 11 '24 20:09 fbmal7

@ChALkeR , @fbmal7 - thanks!

kleydon avatar Sep 12 '24 00:09 kleydon