galaxyproject / cloudlaunch-ui

A user interface for the cloudlaunch app
MIT License
8 stars 13 forks source link

deployment.component.ts(62,9): error TS2322: Type 'Observable<{}>' is not assignable to type 'Observable<Credentials>'. #24

Closed machristie closed 6 years ago

machristie commented 6 years ago

npm start fails for me with the following error.

$ npm start

> cloudlaunch-ui@0.0.0 start /Users/machrist/SGCI/cloudlaunch/cloudlaunch-ui
> ng serve --proxy-config proxy.conf.json

@angular/compiler-cli@5.0.5 requires typescript@'>=2.4.2 <2.5.0' but 2.6.2 was found instead.
Using this version can result in undefined behaviour and difficult to debug problems.

Please run the following command to install a compatible version of TypeScript.

    npm install typescript@'>=2.4.2 <2.5.0'

To disable this warning run "ng set warnings.typescriptMismatch=false".

** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
Date: 2017-12-04T14:49:37.951Z
Hash: 362ce24cbd70322bd57e
Time: 8147ms
chunk {inline} inline.bundle.js (inline) 5.79 kB [entry] [rendered]
chunk {main} main.bundle.js (main) 2.93 kB [initial] [rendered]
chunk {polyfills} polyfills.bundle.js (polyfills) 636 bytes [initial] [rendered]
chunk {styles} styles.bundle.js (styles) 314 kB [initial] [rendered]
chunk {vendor} vendor.bundle.js (vendor) 853 kB [initial] [rendered]

ERROR in src/app/my-appliances/components/deployments/deployment/deployment.component.ts(62,9): error TS2322: Type 'Observable<{}>' is not assignable to type 'Observable<Credentials>'.
  Type '{}' is not assignable to type 'Credentials'.
    Property 'id' is missing in type '{}'.
src/app/my-appliances/components/deployments/deployment/deployment.component.ts(65,88): error TS2345: Argument of type 'Observable<Credentials[]>' is not assignable to parameter of type 'ObservableInput<Credentials>'.
  Type 'Observable<Credentials[]>' is not assignable to type 'ArrayLike<Credentials>'.
    Property 'length' is missing in type 'Observable<Credentials[]>'.
src/app/my-appliances/components/deployments/deployment/deployment.component.ts(66,62): error TS2339: Property 'default' does not exist on type '{}'.

webpack: Failed to compile.
machristie commented 6 years ago

I tried running, as suggested:

npm install typescript@'>=2.4.2 <2.5.0'

but I get the same error when I run npm start.

nuwang commented 6 years ago

Can you try an rm -r node_modules and reinstall the npm packages? I just did that too but couldn't recreate the issue.

nuwang commented 6 years ago

I think this package was the cause of the error: https://github.com/galaxyproject/cloudlaunch-ui/commit/c82fb67a1ce0b7d28111526ff5cd6671fa2a5108

machristie commented 6 years ago

Yeah I tried that too. Also removing package-lock.json.

nuwang commented 6 years ago

Ok, I managed to recreate it after upgrading to Angular 5.05. Did you run an npm update by chance?

machristie commented 6 years ago

I don't think I ran update. I did run an "npm install" after pulling in the new changes on the master branch. My guess: I don't think I had pulled in the recent Angular 5 changes so I think when I did npm install it got the latest Angular 5.

nuwang commented 6 years ago

Yes, something about the generic type parameters in RxJs appears to have changed. The quickest fix for now should be to pull in the latest, and install the package.json defined versions.

nuwang commented 6 years ago

Fixed in: https://github.com/galaxyproject/cloudlaunch-ui/commit/780553d23caf3243454a50f5b00f0a3747a8fa6b