Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class 'Subject<T>' incorrectly extends base class 'Observable<T>' #20

Open
dhrn opened this issue Jun 29, 2017 · 4 comments
Open

Class 'Subject<T>' incorrectly extends base class 'Observable<T>' #20

dhrn opened this issue Jun 29, 2017 · 4 comments

Comments

@dhrn
Copy link

dhrn commented Jun 29, 2017

This is the error I am facing now:

dhrn@dhrn-Inspiron-5548:~/NativeApp/Supervisor$ tns run android

Searching for devices...
iTunes is not available for this operating system. You will not be able to work with connected iOS devices.
Executing before-prepare hook from /home/dhrn/NativeApp/Supervisor/hooks/before-prepare/nativescript-dev-typescript.js
Found peer TypeScript 2.4.1
node_modules/rxjs/Subject.d.ts(16,22): 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'.

node_modules/tns-core-modules/ui/core/properties/properties.d.ts(48,14): error TS2559: Type 'Property<T, U>' has no properties in common with type 'TypedPropertyDescriptor<U>'.

node_modules/tns-core-modules/ui/core/properties/properties.d.ts(59,14): error TS2559: Type 'CoercibleProperty<T, U>' has no properties in common with type 'TypedPropertyDescriptor<U>'.

Unable to apply changes on device: 192.168.56.101:5555. Error is: TypeScript compiler failed with exit code 1.


My configuration:

{
	"description": "NativeScript Application",
	"license": "SEE LICENSE IN <your-license-filename>",
	"readme": "NativeScript Application",
	"repository": "<fill-your-repository-here>",
	"nativescript": {
		"id": "org.nativescript.supervisor",
		"tns-android": {
			"version": "3.1.1"
		}
	},
	"dependencies": {
		"@angular/common": "~4.0.0",
		"@angular/compiler": "~4.0.0",
		"@angular/core": "~4.0.0",
		"@angular/forms": "~4.0.0",
		"@angular/http": "~4.0.0",
		"@angular/platform-browser": "~4.0.0",
		"@angular/platform-browser-dynamic": "~4.0.0",
		"@angular/router": "~4.0.0",
		"nativescript-angular": "~3.0.0",
		"nativescript-telerik-ui": "^2.0.1",
		"nativescript-theme-core": "~1.0.4",
		"reflect-metadata": "~0.1.8",
		"rxjs": "~5.2.0",
		"tns-core-modules": "~3.0.0",
		"zone.js": "0.8.2"
	},
	"devDependencies": {
		"babel-traverse": "6.18.0",
		"babel-types": "6.18.0",
		"babylon": "6.13.1",
		"lazy": "1.0.11",
		"nativescript-dev-typescript": "^0.4.0",
		"typescript": "^2.3.2",
		"zone.js": "~0.7.2"
	}
}


Project Configuration:

dhrn@dhrn-Inspiron-5548:~/NativeApp/Supervisor$ tns info 
All NativeScript components versions information
┌──────────────────┬─────────────────┬────────────────┬───────────────┐
│ Component        │ Current version │ Latest version │ Information   │
│ nativescript     │ 3.1.1           │ 3.1.1          │ Up to date    │
│ tns-core-modules │ 3.1.0           │ 3.1.0          │ Up to date    │
│ tns-android      │ 3.1.1           │ 3.1.1          │ Up to date    │
│ tns-ios          │                 │ 3.1.0          │ Not installed │
└──────────────────┴─────────────────┴────────────────┴───────────────┘

Please kindly help me to fix this issue .

@shanke
Copy link

shanke commented Jul 1, 2017

I have the same error.
Creating a new project with this drawer template - it stops when trying to run ios emulator.

@jimport
Copy link

jimport commented Jul 3, 2017

I've had the same issue. The first error (node_modules/rxjs/Subject.d.ts(16,22): error TS2415:) is related to a bug in rxjs. Reading through the comments, it looks like it is going to be fixed soon. Also a temporary workaround is provided (ReactiveX/rxjs#2539):
Add a augumentations.ts file to your project

// augmentations.ts
import {Operator} from 'rxjs/Operator';
import {Observable} from 'rxjs/Observable';

// TODO: Remove this when a stable release of RxJS without the bug is available.
declare module 'rxjs/Subject' {
  interface Subject<T> {
    lift<R>(operator: Operator<T, R>): Observable<R>;
  }
}

The other two errors are typescript 2.4 related. For me a workaround was to use:

"dependencies": {
  ...
  "rxjs": "5.4.1",
  ...
}
"devDependencies": {
  ...
  "typescript": "2.3.4",
  ...
}

Hope it helps. Cheers

@jimport
Copy link

jimport commented Jul 3, 2017

It seems another option is to use the --noStrictGenericChecks compiler option in typescript 2.4.1. This should be a workaround for all three errors. But I didn't test it ...

@Iheb-miled
Copy link

add

{
    "compilerOptions": {
        "noStrictGenericChecks": true
    }
}

to your tsconfig.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants