When trying to extend a class from a class in a node_modules the typescript compiler throws a error saying:
Property \'source\' is protected but
After listing rxjs modules:
npm list rxjs
+-- @angular/cli@1.6.6 | +-- @angular-devkit/core@0.0.29 | |
-- rxjs@5.5.10 | +-- @angular-devkit/schematics@0.0.52 | |-- rxjs@5.5.10 |-- rxjs@5.5.10-- rxjs@5.5.6
You can see 2 versions of the same module. My project required lower version of rxjs, and e.g. anglular/cli required higher version of rxjs.
It didn't cause any problems before but suddenly all projects with the same dependencies were throwing the same TS90010 errors e.g.:
ERROR in [at-loader] ./src/main/webapp/app/admin/user-management/user-management-detail.component.ts:23:9 TS90010: Type 'Subscription' is not assignable to type 'Subscription'. Two different types with this name exist, but they are unrelated.
Property '_parent' is protected but type 'Subscription' is not a class derived from 'Subscription'.
Finally I updated typescript version in package.json from 2.6.2 to 2.9.2 an all errors disappeared.