Search code examples
angularrxjsangular11aot

TypeError: o.Subject is not a constructor - Angular 11


  1. I have upgraded my Angular version from 5.2 to 11.2
  2. After BUILD I am getting error:

TypeError: o.Subject is not a constructor 3. In development mode I am not getting any error, if I set "aot": false in angular.json file then it's working fine, here are my rxjs packages:

"rxjs": "^6.6.7",
"rxjs-compat": "^6.0.0-rc.0",
"rxjs-tslint": "^0.1.8",

Solution

  • I have upgraded @angular/cdk & @angular/material with latest version, before that the Subject coming from OLD version of these libraries.

    So, upgrade all libraries with Angular version.