Angular 18 Polyfills warning

Discussão em 'Angular' iniciado por Mihai Socaciu, Março 13, 2025.

  1. I just upgraded to Angular 18 and I get the following warning when I do ng serve:


    ▲ [WARNING] Polyfill for "@angular/localize/init" was added automatically. [plugin angular-polyfills]


    In the future, this functionality will be removed. Please add this polyfill in the "polyfills" section of your "angular.json" instead.
    ​

    angular.json

    "build": {
    "builder": "@angular-devkit/build-angular:browser-esbuild",
    "options": {
    "outputPath": "dist/MyClientApp",
    "main": "src/main.ts",
    "index": "src/index.html",
    "polyfills": [
    "src/polyfills.ts"
    ],
    "tsConfig": "tsconfig.app.json",


    polyfills.ts contains the line:

    ...
    import '@angular/localize/init';
    ...


    What could be missing? I have in package.json the "@angular/localize": "^18.0.3",

    Continue reading...

Compartilhe esta Página