Skip to content

Conversation

@clydin
Copy link
Member

@clydin clydin commented Jan 15, 2026

When async-await is disabled (e.g., in Zone.js applications) and the build target is ES2019 or higher, esbuild may incorrectly remove the catch binding of a downleveled for await...of loop during minification.

This change explicitly disables the optional-catch-binding feature in esbuild when async-await support is disabled, forcing esbuild to retain the catch binding and avoiding the minification bug.

Closes #32298

…eveled for-await

When `async-await` is disabled (e.g., in Zone.js applications) and the build target is ES2019 or higher, esbuild may incorrectly remove the catch binding of a downleveled `for await...of` loop during minification.

This change explicitly disables the `optional-catch-binding` feature in esbuild when `async-await` support is disabled, forcing esbuild to retain the catch binding and avoiding the minification bug.

A new integration test has been added to verify that the catch binding is preserved in the optimized output.
@clydin clydin added the target: patch This PR is targeted for the next patch release label Jan 15, 2026
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer area: @angular/build target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Builder produces wrong minified code.

1 participant