Click here to Skip to main content
15,891,976 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am new to Angularjs2, I am not able to build the application Angular2MVC referred in the article. I tried multiple solutions suggested over google, but still not able to resolve, I am receiving few errors as below:

1 Error Build:Class 'WebSocketSubject<t>' incorrectly extends base class 'AnonymousSubject<t>'. Angular2MVC F:\MyLabs\Angular2MVC\node_modules\rxjs\observable\dom\WebSocketSubject.d.ts 23

2.
export declare class Subject<T> extends Observable<T> implements ISubscription {


3.
Severity	Code	Description	Project	File	Line	Suppression State
Error	TS2415	Class 'WebSocketSubject<T>' incorrectly extends base class 'AnonymousSubject<T>'.
  Types of property 'lift' are incompatible.
    Type '<R>(operator: Operator<T, R>) => WebSocketSubject<R>' is not assignable to type '<R>(operator: Operator<T, R>) => Observable<T>'.
      Type 'WebSocketSubject<R>' is not assignable to type 'Observable<T>'.
        Types of property 'operator' are incompatible.
          Type 'Operator<any, R>' is not assignable to type 'Operator<any, T>'.
            Type 'R' is not assignable to type 'T'.	TypeScript Virtual Projects	F:\MyLabs\Angular2MVC\node_modules\rxjs\observable\dom\WebSocketSubject.d.ts	23	Active


4.
Severity	Code	Description	Project	File	Line	Suppression State
Error	TS2415	Class 'Subject<T>' incorrectly extends base class 'Observable<T>'.
  Types of property 'lift' are incompatible.
    Type '<R>(operator: Operator<T, R>) => Observable<T>' is not assignable to type '<R>(operator: Operator<T, R>) => Observable<R>'.
      Type 'Observable<T>' is not assignable to type 'Observable<R>'.
        Type 'T' is not assignable to type 'R'.	TypeScript Virtual Projects	F:\MyLabs\Angular2MVC\node_modules\rxjs\Subject.d.ts	16	Active


Thanks in advance,

Sunil Wagh

What I have tried:

I tried installing new version of TypeScript, I tried to install different versions of TypeScript like 2.4.0 etc, different version of rxjs in Package.json as suggested over google. Also I discarded package.json which is part of the article and tried to create new one with npm init from the command prompt, but the issue is still not resolved.
Posted
Updated 5-Jan-18 5:57am

Add also typescript in nuget
Microsoft.TypeScript.Compiler 2.6.2

"noStrictGenericChecks": true,
in tsconfig.json.
 
Share this answer
 
v2
Comments
Member 10840090 1-Feb-20 9:23am    
I added TypeScript 3.7.3
and your
"noStrictGenericChecks": true,
in tsconfig.json.

Worked fine.
Member 10840090 1-Feb-20 9:39am    
And do not forget to save json before rebuilding.
What article? Articles are not written by the site but by volunteers. They are supported by the people who wrote them.

If you've got an issue with the code in an article here on CP, there is a forum at the bottom of the article to post your concerns. That way, the person who wrote the article will be notified you posted a question or comment.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900