Closed AmitMY closed 6 years ago
Find out why!
I used typescript: ~2.5.0
instead of ~2.3.4
I'm leaving this open because this has to be fixed when ionic uses angular 5
Pasting error in text form for better searchability in these issues:
[12:41:23] typescript: node_modules/ionic-native/node_modules/rxjs/Subject.d.ts, line: 16
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'.
L16: export declare class Subject<T> extends Observable<T> implements ISubscription {
L17: observers: Observer<T>[];
[12:41:23] typescript: node_modules/ionic-native/node_modules/rxjs/observable/dom/WebSocketSubject.d.ts, line: 23
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'.
L23: export declare class WebSocketSubject<T> extends AnonymousSubject<T> {
L24: url: string;
This is a bigger problem now that https://github.com/ionic-team/ionic/releases/tag/v3.9.0 has dropped - 3.9.0 introduces rxjs 5.5.2 and Angular5!
This will (very hopefully) be resolved by https://github.com/ionic-team/ionic-native/pull/2089
@AmitMY can you share the results of an npm ls rxjs
from your app directory? I am curious if this problem is caused by having multiple rxjs versions in various packages.
I see that ionic-native is already using rxjs 5.5.2, yet my repo shows the same errors. Here's my npm ls rxjs
output:
✗ npm ls rxjs
aurora-app@1.2.0-beta.3 /Users/emcniece/Code/ionic/aurora-app
├─┬ aurora-js@1.0.0 -> /Users/emcniece/Code/nodejs/aurorajs
│ ├─┬ rx-http-request@1.2.0
│ │ └── rxjs@5.4.0 deduped
│ └── rxjs@5.4.0
├─┬ ionic-native@2.9.0
│ └── rxjs@5.0.1
└── rxjs@5.5.2
cc @danbucholtz any thoughts on the above? See #2089 for a PR to update deps
Aha... figured it out. We have a deprecated version of ionic-native
installed!
We no longer need the ionic-native
module - we just need @ionic-native/core
.
Running npm uninstall ionic-native --save
builds successfully.
@AmitMY your shared package.json doesn't explicitly list ionic-native
as an included package, but the paths in your screenshot indicate that this module is present in your system. Try running the uninstall command above.
The issue for me was that I was using @ionic/cloud-angular
, which is now deprecated in favour of Ionic Pro. An outdated version of ionic-native
is a dependency of @ionic/cloud-angular
.
//lift<T>(operator: Operator<T,R>): Observable<T>;
worked for me
Thanks @hellios123 !
@hellios123 Indeed, commething this line helped me. But I cannot grasp the underlying problem that is causing this bug. commenting a line of code should not be a way of fixing things
@hellios123 Thanks! I agree with @FloryanFilip
I'm submitting a ... (check one with "x") [x] bug report [ ] feature request
Current behavior: Running
ionic serve
gives the following error: (you can see the error originates fromionic-native
's rxjs)Expected behavior:
No error
Steps to reproduce: No Idea
package.json info: