Command
build
Is this a regression?
The previous version in which this bug was not present was
@angular/build 19.2.20
Description
@angular/build@19.2.25 bumped its esbuild dependency from 0.25.4 to 0.28.0. This causes builds to fail when the browserslist includes targets like iOS >= 14 or Chrome >= 79:
✘ [ERROR] Transforming destructuring to the configured target environment
("chrome79.0", "edge141.0", "firefox140.0", "ios14.0", "safari18.0") is not supported yet
node_modules/zone.js/fesm2015/zone.js:140:12:
140 │ const {
╵ ^
All configured targets support destructuring natively (Chrome since 49, iOS Safari since 10). esbuild 0.28+ intentionally errors when it encounters syntax it cannot downlevel (evanw/esbuild#4436, closed as "not planned"), but @angular/build does not set supported: { destructuring: true } to inform esbuild that no lowering is needed.
Vite encountered the same issue and shipped a fix in vitejs/vite#22346 by setting supported.destructuring: true when targets are above the buggy Safari range (Safari >= 14.1 / iOS >= 14.5).
Workaround: add "overrides": { "esbuild": "0.27.4" } to package.json.
Suggested fix: Apply the same approach as Vite — set supported: { destructuring: true } in the esbuild options when browserslist targets are above Safari 14.0 / iOS 14.4.
Related issues:
Minimal Reproduction
ng new repro-app --style=css --routing=false --ssr=false
- Add
.browserslistrc in the project root with the following content:
Chrome >= 79
iOS >= 14.0
last 2 Safari major versions
- Ensure
@angular/build@19.2.25 is installed (check package-lock.json)
- Run
ng build
Expected: Build succeeds — all targets support destructuring natively.
Actual: Build fails with:
✘ [ERROR] Transforming destructuring to the configured target environment
("chrome79.0", "ios14.0", ...) is not supported yet
node_modules/zone.js/fesm2015/zone.js:140:12
Note: The error is triggered by any dependency using const { ... } = syntax (e.g., zone.js/fesm2015/zone.js, swiper). Reverting to @angular/build@19.2.20 (which uses esbuild 0.25.4) resolves the issue.
Exception or Error
✘ [ERROR] Transforming destructuring to the configured target environment ("chrome79.0", "ios14.0", "safari18.0" + 5 overrides) is not supported yet
Your Environment
Angular CLI: 19.2.20
@angular/build: 19.2.25 (esbuild 0.28.0)
Node: 22.x
OS: macOS / Linux
.browserslistrc:
Chrome >= 79
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
iOS >= 14.0
Firefox ESR
Anything else relevant?
No response
Command
build
Is this a regression?
The previous version in which this bug was not present was
@angular/build 19.2.20
Description
@angular/build@19.2.25bumped its esbuild dependency from0.25.4to0.28.0. This causes builds to fail when the browserslist includes targets likeiOS >= 14orChrome >= 79:All configured targets support destructuring natively (Chrome since 49, iOS Safari since 10). esbuild 0.28+ intentionally errors when it encounters syntax it cannot downlevel (evanw/esbuild#4436, closed as "not planned"), but
@angular/builddoes not setsupported: { destructuring: true }to inform esbuild that no lowering is needed.Vite encountered the same issue and shipped a fix in vitejs/vite#22346 by setting
supported.destructuring: truewhen targets are above the buggy Safari range (Safari >= 14.1 / iOS >= 14.5).Workaround: add
"overrides": { "esbuild": "0.27.4" }topackage.json.Suggested fix: Apply the same approach as Vite — set
supported: { destructuring: true }in the esbuild options when browserslist targets are above Safari 14.0 / iOS 14.4.Related issues:
Minimal Reproduction
ng new repro-app --style=css --routing=false --ssr=false.browserslistrcin the project root with the following content:@angular/build@19.2.25is installed (checkpackage-lock.json)ng buildExpected: Build succeeds — all targets support destructuring natively.
Actual: Build fails with:
Note: The error is triggered by any dependency using
const { ... } =syntax (e.g.,zone.js/fesm2015/zone.js,swiper). Reverting to@angular/build@19.2.20(which uses esbuild0.25.4) resolves the issue.Exception or Error
Your Environment
Anything else relevant?
No response