Apollo-angular: Angular 6 is out :)

Created on 4 May 2018  路  17Comments  路  Source: kamilkisiela/apollo-angular

Hello,

I'm trying to update my application to Angular6, but I have an issue.
Here is what I get when I do a ng update @angular/core

Package "apollo-angular" has an incompatible peer dependency to "rxjs" (requires "^5.0.1", would install "6.1.0").

Could you have a look?
Let me know if you need help :)

Most helpful comment

Actually, it's going forward and my build is running :)
But I have errors in the browser console:

ERROR TypeError: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
    at subscribeTo (subscribeTo.js:41)
    at from (from.js:17)
    at new QueryRef (QueryRef.js:6)
    at Apollo.push../node_modules/apollo-angular/Apollo.js.ApolloBase.watchQuery

Do you have another magic trick?
Thx for your help

All 17 comments

Hello @jycouet,

I also have a project with apollo-angular, I simply installed this package in my local project:

npm i -S rxjs-compat

Then do this:

npm i -g rxjs-tslint
rxjs-5-to-6-migrate -p src/tsconfig.app.json

And works fine!

This is necessary until the apollo-angular update your code to work with rxjs@6.

Hugs!

WoW, that works soooooooooooooooooo well :)
Thanks 馃嵕 馃

Haha, I'm happy to help my friend!
Big Hug!

Also, full support for Angular 6 has been in progress for some time now: #580

Actually, it's going forward and my build is running :)
But I have errors in the browser console:

ERROR TypeError: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
    at subscribeTo (subscribeTo.js:41)
    at from (from.js:17)
    at new QueryRef (QueryRef.js:6)
    at Apollo.push../node_modules/apollo-angular/Apollo.js.ApolloBase.watchQuery

Do you have another magic trick?
Thx for your help

@plinionaves keep the free hugs goin' man!

Another issue preventing an upgrade:

Package "apollo-angular-link-http-batch" has an incompatible peer dependency to "@angular/core" (requires "^4.3.0 || ^5.0.0-rc.0",would install "6.0.0")

@jycouet Have you work this out ? Upgrade today, meet the same problem

Hello @jycouet, sorry for the delay...

I'm not sure, but this looks like some code error, you have many watchQueries? I recommend check his, mainly in use of Observable operators.

Tip: can try to search use of "catch" in your code, if you have something like this:

myObservable
   .catch(...

Change to this:

myObservable
   .pipe(
       catchError(err => /* do something */)
    )

Do the test.

Hug!

@jycouet this seems to be related to #545 (which also references #580). The workaround that is mentionend there, did fix the invalid object error.

when will #580 get released ?

The milestone states May 12th, though there is still quite a lot open - @kamilkisiela can probably tell best.

馃槩 we have to disable all apollo apis to let project running, so sad.

545 worked well for me 馃憤

Tmp fix is nice, waiting for @kamilkisiela ;)

Thank you so much for keeping us posted @kamilkisiela !

You can now yarn add apollo-angular@next, later today I'll release a stable version.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GlauberF picture GlauberF  路  6Comments

CaerusKaru picture CaerusKaru  路  3Comments

crumhorn picture crumhorn  路  6Comments

patriknil90 picture patriknil90  路  7Comments

moltma picture moltma  路  4Comments