Argument of type 'MonoTypeOperatorFunction<any>' is not assignable to parameter of type 'UnaryFunction<Observable<any>, Observable<any>>'

argument of type is not assignable to parameter of type 'component'
argument of type 'reacttext'
is not assignable to parameter of type 'ngmodule types of property 'providers' are incompatible
argument of type 'string | undefined' is not assignable to parameter of type 'string
argument of type 'string' is not assignable to parameter of type 'takeablechannel<unknown>
argument of type '()' is not assignable to parameter of type react
argument of type '( static: boolean; )' is not assignable to parameter of type '( read?: any)
argument of type is not assignable to parameter of type 'never

i am trying to migrate from rxjs 5 to 6 but i am having difficulties. when i try this

this._connectivity.isOnline().pipe(first()).subscribe((state) => {
  this.syncCheck(user.uid);
});

i am getting this error

Argument of type 'MonoTypeOperatorFunction<any>' is not assignable to parameter of type 'UnaryFunction<Observable<any>, Observable<any>>'.
  Types of parameters 'source' and 'source' are incompatible.
    Type 'import("/home/User/Desktop/projectname/node_modules/rxjs/Observable").Observable<any>' is not assignable to type 'import("/home/User/Desktop/projectname/node_modules/rxjs/internal/Observable").Observable<a...'.
      Property 'map' is missing in type 'Observable<any>'.

You seem to have a wrong import for the isOnline() return type. Make sure that you always import from rxjs and never from rxjs/internal or even rxjs/internal/Observable. (Operators like first() must be imported from rxjs/operators)

TS2345 Argument of type A is not assignable to parameter of type A , declare function decorate<T>(): (component: T) => T; class Foo { derp () {} } decorate<Foo>()(Foo);. error TS2345: Argument of type 'typeof Foo' is  An argument is a claim that is backed by evidence supporting a main idea. Go though this article to discover the different types/kinds of arguments.

I found the same error with my code:

let source = of([1, 2, 3, 45, 56, 7, 7])
    .pipe(
        filter((x: number) => x % 2 == 0)
    );

TS2345: Argument of type 'MonoTypeOperatorFunction' is not assignable to parameter of type 'OperatorFunction'.

To fix this, remove type from filter function

 filter(x => x % 2 == 0)

Now you have error

The left-hand side of an arithmetic operation must be of type 'any', 'number', so make sure, that this annoying filter gets correct data type

filter(x => Number(x) % 2 == 0) // parse element to number

But now code stops work. Finally, to fix this, change of to from, at the beginning.

let source = from([1, 2, 3, 45, 56, 7, 7])
    .pipe(
        filter((x: number) => Number(x) % 2 === 0)
    )

or

let source = of(1, 2, 3, 45, 56, 7, 7)
.pipe(
        filter((x: number) => Number(x) % 2 === 0)
    )

So, cause of error was my initial data structure.

I think, that my example can help you with dealing similar problems.

Argument of type '"USER_LOGIN_REQUEST"' is not assignable to , Argument of type '"USER_LOGIN_REQUEST"' is not assignable to parameter of type 'TakeableChannel<unknown>' in yeild takeLatest #1883. Closed. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. Learn more C++ argument of type is incompatible with parameter of type

I had similar error using pipe in one of HTTP services method (see example on the bottom). The problem was lack of typing in callback function used in subscribe. In your case, add typing (not the best idea but even any) to state or remove the parenthesis:

Solution 1:

this._connectivity.isOnline()
  .pipe(first()).subscribe((state: any) => {
    this.syncCheck(user.uid);
});

Solution 2:

this._connectivity.isOnline()
  .pipe(first()).subscribe(state => {
    this.syncCheck(user.uid);
});

Coming back to my case I've used pipe to log log the data. It required to set two possible types to the observable, then typing callback function was possible:

  public getPrice(): Observable<string | PriceDTO> {
    return this.http.get<PriceDTO>(`api/price)
      .pipe(
        tap((data: PriceDTO) => console.log('PRICE: ', data)),
        catchError((val: Error) => of(`I caught: ${val}`))
      );
  }

Generics · TypeScript, While type argument inference can be a helpful tool to keep code shorter and more readable, you may need to explicitly pass in the type arguments as we did in  So I think the warning should really say argument of type "const char*" is incompatible with parameter of type "char*". I think the compiler is confused because it's an intrinsic (i.e. there is no prototype in the header file).

I have such issue, first scan wasn't working, so I changed

  .pipe(scan((count ) => count + 1, 0))...

To

  .pipe(scan((count:any ) => count + 1, 0))

Then the problem also was that the Rxjs was installed also at the parent folder of this app. So removing this,I believe have fix the problem.

Using npm-check package is good idea for cleaning problem either global and local level of npm packages.

Generic Parameters and Arguments, This chapter describes parameters and arguments for generic types, functions, and initializers. When you declare a generic type, function, subscript, or initializer,​  4. Conclusion: Python Function Arguments. Hence, we conclude that Python Function Arguments and its three types of arguments to functions. These are- default, keyword, and arbitrary arguments. Where default arguments help deal with the absence of values, keyword arguments let us use any order.

"input of argument types 'double'" meaning?, "input of argument types 'double'" meaning? Follow. 948 views (last 30 days). Deductive arguments may be either valid or invalid. If an argument is valid, it is a valid deduction, and if its premises are true, the conclusion must be true: a valid argument cannot have true premises and a false conclusion. An argument is formally valid if and only if the denial of the conclusion is incompatible with accepting all the premises.

Argument, Standard types[edit]. Argument terminology. There are several kinds of arguments in logic, the best-known of which  Union types can be a bit tricky here, but it just takes a bit of intuition to get used to. If a value has the type A | B, we only know for certain that it has members that both A and B have. In this example, Bird has a member named fly. We can’t be sure whether a variable typed as Bird | Fish has a fly method.

Type Arguments - AngelikaLanger.com, Do type parameter bounds restrict the set of types that can be used as type arguments? Do I have to specify a type argument when I want to use a generic type? Naturalistic fallacy fallacy is a type of argument from fallacy. Straw man fallacy – an argument based on misrepresentation of an opponent's position, especially to attack a weaker version of it rather than the argument actually presented. Also known as the weak man fallacy.

Comments
  • can you show the imports for this code snippet?