question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

watchQuery broken with rxjs 6.0.0-rc.0 and rxjs-compat 6.0.0-rc.0

See original GitHub issue
const GetTodo = gql`
  query getTodo {
    getTodo(id: "1234") {
      id
      name
      completed
    }
  }
`;
...
ngOnInit() {
    this._apollo.query({ query: GetTodo })
      .subscribe(x => console.log(x));  
      // OK

    this._apollo.watchQuery<any>({ query: GetTodo })
      .valueChanges
      .subscribe(x => console.log(x)); 
      // DashboardComponent_Host.ngfactory.js? [sm]:1 ERROR TypeError: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
  }
...

here is the call stack: screen shot 2018-04-04 at 10 27 31 pm

here is the package.json (excerpt)

"dependencies": {
    "@angular/animations": "5.2.9",
    "@angular/cdk": "^5.2.3",
    "@angular/common": "5.2.9",
    "@angular/compiler": "5.2.9",
    "@angular/core": "5.2.9",
    "@angular/forms": "5.2.9",
    "@angular/http": "5.2.9",
    "@angular/material": "^5.2.3",
    "@angular/platform-browser": "5.2.9",
    "@angular/platform-browser-dynamic": "5.2.9",
    "@angular/router": "5.2.9",
    "apollo-angular": "^1.0.1",
    "apollo-angular-link-http": "^1.0.2",
    "apollo-cache-inmemory": "^1.1.12",
    "apollo-client": "^2.2.8",
    "core-js": "^2.4.1",
    "graphql": "^0.13.2",
    "graphql-tag": "^2.8.0",
    "jwt-decode": "^2.2.0",
    "rxjs": "6.0.0-rc.0",
    "rxjs-compat": "6.0.0-rc.0",
    "zone.js": "^0.8.23"
  },

when I downgrade to rxjs 5.5.8, it works perfectly.

Sorry that I can’t reproduce the error at stackblitz, since I don’t know any public api. If you know some, I would love to do so. Thanks

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
sarora2073commented, May 11, 2018

upgrading to 1.1.0-rc.0 works!

4reactions
kamilkisielacommented, May 11, 2018

@bradleybeighton 1.1.0-rc.0 is available right now, about 1.1.0 after the weekend, for sure.

Read more comments on GitHub >

github_iconTop Results From Across the Web

watchQuery broken with rxjs 6.0.0-rc.0 and rxjs-compat 6.0 ... - GitHub
watchQuery broken with rxjs 6.0.0-rc.0 and rxjs-compat 6.0.0-rc.0 #545 ... That's because RxJS no longer uses polyfill of Symbol.observable .
Read more >
rxjs-compat - npm
This is a rewrite of Reactive-Extensions/RxJS and is the latest production-ready version of RxJS. This rewrite is meant to have better ...
Read more >
Angular 5 to 6 Without Backward Compatible RxJS (rxjs-compat)
I'm involved in the rather arduous task of migrating a project from Angular 5.2.11 to 6.0.0, and I'm having some difficulty with RxJS...
Read more >
rxjs-compat - NPM Package Overview - Socket.dev
Here, we're using the built-in pipe method on Observables to combine operators. See pipeable operators for more information. CommonJS via npm.
Read more >
cannot find module 'rxjs' or its corresponding type declarations
It worked fine with rxjs@7.0.0-rc.2 , but not with rxjs@7.0.0 . I suspect the references and the typesVersions addition are to blame. What...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found