Search code examples
angularnpmangular-language-service

Angular extension might not work correctly because ngcc operation failed


enter image description here

This is the error I am getting.

enter image description here

However ng serve is running without any issues.

enter image description here

I am also getting this is a problem but I have imported ReactiveFormsModule correctly and it is also working as expected in the website I am just getting this error randomly.

I tried deleting node_modules multiple times, I even deleted the npm cache folder in my Local but still getting this error after npm i. This is a new project I created with Angular 16.

{
  "name": "testProject",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^16.1.1",
    "@angular/common": "^16.1.1",
    "@angular/compiler": "^16.1.1",
    "@angular/core": "^16.1.1",
    "@angular/forms": "^16.1.1",
    "@angular/platform-browser": "^16.1.1",
    "@angular/platform-browser-dynamic": "^16.1.1",
    "@angular/router": "^16.1.1",
    "@ngrx/effects": "^16.0.1",
    "@ngrx/store": "^16.0.1",
    "@ngrx/store-devtools": "^16.0.1",
    "rxjs": "~7.8.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.13.0"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^16.1.1",
    "@angular/cli": "^16.1.1",
    "@angular/compiler-cli": "^16.1.1",
    "@types/jasmine": "~4.3.0",
    "jasmine-core": "~4.6.0",
    "karma": "~6.4.0",
    "karma-chrome-launcher": "~3.2.0",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.1.0",
    "typescript": "~5.1.3"
  }
}

Any help and suggestions appreciated.


Solution

  • My issue was with Visual Studio Code.

    My Angular version is v16.1.1 but VS Code was somehow downloading Angular Language Service v15.2.4.

    Reinstalled Visual Studio Code and it fixed the issue.

    If you're having the same issue check if the Angular Language Service extension version and angular version are compatible.