2

I'm getting error like this

**Build:Class 'Subject<T>' incorrectly extends base class 'Observable<T>** .

I have installed TypeScript 2.4.1 and downloaded angular quick starter files from git angular quick starter files and copied src folder , bs-config.json, package.json , tslint.json files to the project (I have created one empty template project in ASP.NET MVC). While rebuilding I'm getting this error. What to do?

Averla Team
  • 407
  • 1
  • 6
  • 16
  • There was a conflict last month caused by rxjs... Update that package – Jason Spradlin Aug 10 '17 at 05:06
  • 1
    Possible duplicate of [rxjs/Subject.d.ts error : Class 'Subject' incorrectly extends base class 'Observable'](https://stackoverflow.com/questions/44793859/rxjs-subject-d-ts-error-class-subjectt-incorrectly-extends-base-class-obs) – cartant Aug 10 '17 at 05:17
  • 1
    It's a mystery why you would use Angular quick starter instead of angular-cli. –  Aug 10 '17 at 05:39
  • some one deleted the answer ? what to do ? – Averla Team Aug 10 '17 at 06:09
  • @AverlaTeam sorry i just removed my `assuming answer` as I do not have a time to continue to participate on that atm. @torazaburo The reason I mention that global `tsc` can interferer wit local version as I experienced that long ago myself but seam like it is fixed now. I said that `angular` is not properly compiled with the `typescript 2.4` is based on that issue https://github.com/angular/angular/issues/18454 – angularrocks.com Aug 10 '17 at 06:12
  • The question is a dupe. The starter you are using appears to have RxJS 5.0.1 as a dependency. That is an old version and will effect the error mentioned in the title - and in the dupe target - when TypeScript 2.4 is used. – cartant Aug 10 '17 at 06:16

2 Answers2

2

I have uninstalled TypeScript from the control panel and installed using NuGet. Now it's working.

PM => Install-Package Microsoft.TypeScript.Compiler -Version 2.1.5

Massimiliano Kraus
  • 3,638
  • 5
  • 27
  • 47
Averla Team
  • 407
  • 1
  • 6
  • 16
0

That problem was fixed in RxJS but you should compile it using TypeScript 2.4 Open the .csproj with a notepad and look for this tag

<typescripttoolsversion>1.8</typescripttoolsversion>

change it to and compile.

<typescripttoolsversion>2.4</typescripttoolsversion>
Zinov
  • 3,817
  • 5
  • 36
  • 70