changeDetection must be a member of ChangeDetectionStrategy enum from @angular/core

Discussão em 'Angular' iniciado por Thomas, Março 12, 2025.

  1. Thomas

    Thomas Guest

    After updating from Angular 19.1.4 to 19.2.2, I get following error when using changeDetection: ChangeDetectionStrategy.OnPush:

    changeDetection must be a member of ChangeDetectionStrategy enum from @angular/core
    Value is of type 'ChangeDetectionStrategy$1'.(-991010)


    (ChangeDetectionStrategy is imported from @angular/core as this answer suggests.)

    I had no errors before upgrading.

    diff --git a/package.json b/package.json
    index 0540c6d..31c4180 100644
    --- a/package.json
    +++ b/package.json
    @@ -16,32 +16,32 @@
    "@angular/common": "^19.0.0",
    "@angular/compiler": "^19.0.0",
    "@angular/core": "^19.0.0",
    - "@angular/forms": "^19.1.4",
    + "@angular/forms": "^19.2.2",
    "@angular/platform-browser": "^19.0.0",
    - "@angular/platform-browser-dynamic": "^19.1.4",
    - "@angular/router": "^19.1.4",
    - "@angular/service-worker": "^19.1.4",
    + "@angular/platform-browser-dynamic": "^19.2.2",
    + "@angular/router": "^19.2.2",
    + "@angular/service-worker": "^19.2.2",
    "rxjs": "~7.8.0",
    "tslib": "^2.3.0"
    },
    "devDependencies": {
    - "@angular-devkit/build-angular": "^19.1.5",
    - "@angular/cli": "^19.1.5",
    - "@angular/compiler-cli": "^19.1.4",
    + "@angular-devkit/build-angular": "^19.2.2",
    + "@angular/cli": "^19.2.2",
    + "@angular/compiler-cli": "^19.2.2",
    "@eslint/css": "^0.1.0",
    "@eslint/js": "^9.17.0",
    - "@typescript-eslint/eslint-plugin": "^8.22.0",
    - "@typescript-eslint/parser": "^8.22.0",
    + "@typescript-eslint/eslint-plugin": "^8.26.1",
    + "@typescript-eslint/parser": "^8.26.1",
    "angular-eslint": "19.0.2",
    - "eslint": "^9.19.0",
    - "globals": "^15.14.0",
    - "ng-packagr": "^19.1.2",
    + "eslint": "^9.22.0",
    + "globals": "^15.15.0",
    + "ng-packagr": "^19.2.0",
    "typescript": "~5.6.2",
    "typescript-eslint": "8.18.0"
    }

    Continue reading...

Compartilhe esta Página