-
Notifications
You must be signed in to change notification settings - Fork 642
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
Feature request: Improved error async arrow functions are unsupported
#1395
Comments
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 |
## Explanation Our package has exported async arrow functions, which cannot be compiled during the `detox build android` step on mobile. <details><summary>See error logs</summary> ![Screenshot 2024-09-20 at 21 16 55](https://github.com/user-attachments/assets/08c49d3e-b448-40cf-ad23-715dbd10d185) </details> It is most likely related to this hermes error: facebook/hermes#1395 This removes the exported async arrow functions in the bundle for normal async functions. Long term we should either: - Add ESLint rules to prevent other devs or teams being burnt by this - Or have a transpilation step to avoid async arrow functions. ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> https://consensyssoftware.atlassian.net/browse/NOTIFY-1144 ## Changelog ### `@metamask/profile-sync-controller` - **CHANGED**: updated exported async arrow functions to normal async functions. ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've highlighted breaking changes using the "BREAKING" category above as appropriate - [x] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes
Problem
async arrow functions (ignored by Babel) trigger Hermes error
hermes/lib/IRGen/ESTreeIRGen-func.cpp
Line 215 in 4ab9f17
causing
./gradlew :app:installRelease
to failafter Metro finishes bundling
Solution
it would be great if Hermes would output instead
async arrow functions are unsupported
Additional Context
async generators are unsupported
errors #1389nb: i think Static Hermes will be supporting arrow functions too
The text was updated successfully, but these errors were encountered: