question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Argument of type 'QueueingSubject<{}>' is not assignable to parameter of type 'Observable<any>'

See original GitHub issue

With rxjs-websockets 1.1.0, queueing-subject 0.1.1 & typescript 2.4.2 I have the following code:

import Rx from "rxjs/Rx";
import { QueueingSubject } from "queueing-subject";
import websocketConnect, {Connection} from "rxjs-websockets";

const queuingSubject = new QueueingSubject();

// ...

const connection: Connection =  websocketConnect(
    myUrl,
    queuingSubject,
    myWebSocket
);

After upgrading from rxjs 5.4.2 to 5.4.3 I get the following type error in the webSocketConnect call:

error TS2345: Argument of type 'QueueingSubject<{}>' is not assignable to parameter of type 'Observable<any>'.  
Property 'source' is protected but type 'Observable<T>' is not a class derived from 'Observable<T>'.

I cleaned the cache (I’m using yarn), deleted node_modules and reinstalled but still get this error…

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
danielcrispcommented, Oct 13, 2017

Great! Thanks James

1reaction
insidewhycommented, Oct 13, 2017

Relying on npm dependency duplication as I had advised isn’t a good idea at all… in a previous package I was told by someone I was handling dependencies wrong and they misinformed me and I never bothered to verify. I’ve taken the time to understand peer dependencies fully now and can see it is the right choice for this project.

Released version 4.0.0 with the fix, sorry for the confusion!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Argument of type 'QueueingSubject<{}>' is not assignable to ...
You need to add a type parameter to the queueing subject and ensure you have a single rxjs module in your node_modules (by...
Read more >
angular - Type 'Observable<any>' is not assignable to type '[]'
I am pretty new in Angular2/TypeScript so please excuse me if I am doing some stupid mistake. What I am trying to do...
Read more >
type 'observable<object>' is not assignable to type
above code gives me Argument of type '(payload: any) => void' is not assignable to parameter of type '(value: any, index: number) =>...
Read more >
Typescript Error: Type 'Observable<any[]>' is not assignable to ...
in my app, this value's type is Feed.interface.ts type. But return value from firebase is any. and console error happened. I tried to...
Read more >
Argument of type 'string' is not assignable to parameter of type
I'm new to Typescript and trying to do a project with it to get better, but I've been unable to solve this issue...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found