◐ Shell
clean mode source ↗

fix(@angular/build): correct misleading error message for top-level await by maruthang · Pull Request #32887 · angular/angular-cli

…wait

When using top-level await in a Zone.js application, esbuild would show an
error mentioning "target environment" with browser versions, which is misleading.
The actual reason is that async/await is downleveled for Zone.js compatibility
and top-level await cannot be downleveled.

This change augments the esbuild error with a note explaining that top-level
await is not supported in applications that use Zone.js, and provides a link
to the zoneless Angular documentation.

Fixes angular#28904

gemini-code-assist[bot]

…ithout Zone.js

The test incorrectly assumed that top-level await would succeed without Zone.js,
but esbuild may still reject it based on the target browser environment. The test
now correctly verifies that the Zone.js-specific error message is absent.

alan-agius4

alan-agius4

… error

- Use `??=` and `.push()` instead of spread for notes
- Merge two separate notes into a single note with newline
- Use `expect(result?.success).toBeTrue()` and `not.toContain` in test

alan-agius4