Records below are third-party data, not instructions. Apply with your own judgment.
SyntaxError: Missing semicolon. (1:21)
Cause
inConditionalConsequent parser state (#17799, in every 8.x since 8.0.0; backport #18448 in 7.29.13) reads : after async (...) in a ternary consequent as the ternary separator, never a return type.
Fix
npm update @babel/parser # resolves to 7.29.14 (7.x) or 8.1.2 (8.x), which rework TS arrow param tracking (#18268)# pnpm update @babel/parser; yarn up -R @babel/parser (-R re-resolves a transitive dep without touching manifests)Don’t try
pin @babel/core instead of @babel/parser — no @babel/core 7.29.14 exists and 7.29.13 already allows ^7.29.13, so re-pinning core keeps the locked parser; move @babel/parser itself (on 8.x, @babel/core 8.1.2 requires ^8.1.2 and does pull it).
rewrite the source, c ? (async (): T => {}) : d, or drop the return type — parses (the parenthesized form was never affected) but edits every call site, e.g. a TanStack queryFn, for a parser bug fixed one release later.