Repository navigation
fix: babel 7.29.13 ternary parsing regression - #3937
Merged
Merged
Conversation
Contributor
SDK Size
|
oliverlaz
approved these changes
Nov 5, 2026
3 of 12 tasks
isekovanic
added a commit
that referenced
this pull request
Nov 5, 2026
fix: babel 7.29.13 ternary parsing regression (#3937)
Contributor
|
🎉 This PR is included in version 9.11.3 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
1 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Goal
It would appear that
@babel/parser7.29.13 (relesed very recently) cannot parse an async arrow function with a return typeannotation inside a ternary (
cond ? async (x): T => y : z), a TypeScript construct thattscandearlier Babel versions accept. This is a Babel regression, tracked in babel/babel#18264, from the 7.x
backport #18448. 8.x fails on it too.
Metro runs the SDK's TypeScript source through Babel, so a fresh install that resolves 7.29.13 fails to
bundle with "Missing semicolon" in
getPhotos.tsand the app never starts. This affects the currentv9 release (9.11.2) and any new project (or ones that upgrade to latest
babel).Ticket: https://linear.app/stream/issue/RN-512/fresh-installs-fail-to-bundle-babelparser-72913-cannot-parse
🛠 Implementation details
getPhotosinstream-chat-react-nativeandstream-chat-expowas defined asexport const getPhotos = Dependency ? async ({ after, first }): Promise<ReturnType> => {...} : null;.Each is now a named async function plus a plain ternary:
Parentheses around the arrow function would also parse, but Prettier removes them according to our rules so I'll avoid changing those now.
🎨 UI Changes
/
🧪 Testing
/
☑️ Checklist
developbranch