Description
Command
serve, build
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
19.0.0-next.13
Description
Application throws an error at startup when using the webpack builder with optimizations enabled and targeting browsers like Safari < 15 or Chrome < 84.
I think it may be linked to private class fields because of the browsers version but maybe not.
Minimal Reproduction
Set up a .browserslistrc
file with either Safari >= 14
or Chrome >= 83
,
Configure angular.json
to use the @angular-devkit/build-angular:browser
builder,
Set "optimization": true
and "buildOptimizer": true
,
Run ng serve
.
Here is a stackblitz following the above instructions: https://stackblitz.com/edit/stackblitz-starters-fr33hnlm?file=.browserslistrc
Exception or Error
NullInjectorError: R3InjectorError[t -> nt -> nt]:
NullInjectorError: No provider for nt!
Your Environment
Angular CLI: 19.0.0-rc.0
Node: 22.12.0
Package Manager: npm 10.9.0
OS: win32 x64
Angular: 19.0.0-rc.0
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1900.0-rc.0
@angular-devkit/build-angular 19.0.0-rc.0
@angular-devkit/core 19.0.0-rc.0 (cli-only)
@angular-devkit/schematics 19.0.0-rc.0
@schematics/angular 19.0.0-rc.0
rxjs 7.8.1
typescript 5.5.4
zone.js 0.15.0
Anything else relevant?
I've noticed that the latest next
versions (of both angular
and angular-cli
) do not have this issue but the first rc
does.
@angular-devkit/build-angular:browser-esbuild
builder seems to work fine.