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.

Move rxjs to peerDependencies to allow custom versions usage

See original GitHub issue

Error for client example from https://kamilmysliwiec.gitbooks.io/nest/content/real-time/microservices/basics.html

        this.client.send(pattern, data)
            .catch((err) => Observable.empty())
[ts] Property 'catch' does not exist on type 'Observable<{}>'.

this does not help

import { Observable } from 'rxjs';
import 'rxjs/add/operator/catch';

skipping via

(<any> this.client).send(pattern, data)

provides error at runtime

[Nest] 9905   - 5/10/2017, 3:44:13 AM   [ExceptionsHandler] this.client.send(...).catch is not a function
TypeError: this.client.send(...).catch is not a function

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:22 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
kamilmysliwieccommented, May 14, 2017

Hi @artaommahe, Since ~2.0.0 rxjs is used as a peerDependency.

2reactions
zachgrayiocommented, May 10, 2017

Looks like an rxjs5 modularity issue.

Making this change in client-prox.d.ts solves the issue it seems:

import * as Rx from 'rxjs/Rx'; // import all of rx. using the operator add import HERE solves the issue too
import { Observer } from 'rxjs/Observer';

export declare abstract class ClientProxy {
    abstract sendSingleMessage(pattern: any, callback: any): any;
    send<T>(pattern: any, data: any): Rx.Observable<T>;
    createObserver<T>(observer: Observer<T>): (err: any, result: any) => void;
}

Might be best to open an issue over on rxjs to see what the preferred solution here is, I’m not entirely sure - though seems like its probably a pretty common issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Move rxjs to peerDependencies to allow custom versions usage ...
I am getting "TypeError: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable....
Read more >
npm Peer Dependencies - JavaScript inDepth
In this article I clarify what npm Peer Dependencies are and especially when you should use them. Peer Dependencies are listed in the...
Read more >
How do I resolve peer dependency error: The package react ...
Use the following command to resolve this when installing the node module. npm install --legacy-peer-deps. if above doesn't work for you then you...
Read more >
Building a Library in Angular 11 with Dependencies - Medium
Let's move our ngx-exharts and echarts under dependencies in our library package.json to peerDependencies and copy the same into our ...
Read more >
Schematics for libraries - Angular
With your schematics, your users can use ng add to install an initial version of your ... Your library needs a custom Typescript...
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