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.

TypeError: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.

See original GitHub issue
  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I’m reporting the issue to the correct repository (not related to Angular, AngularCLI or any dependency)

Expected Behavior

Make e2e tests

Current Behavior

Failure with the following error: TypeError: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.

Failure Information (for bugs)

It seems to be something when running e2e cypress test with a react project

Steps to Reproduce

npm run e2e react-app-e2e

Context

  • version of Nx used 8.6.0

Failure Logs

TypeError: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
    at Object.exports.subscribeTo (/Users/jose.sanchez/Documents/shapeletsProjects/@shapelets-cristal-ui/node_modules/rxjs/internal/util/subscribeTo.js:29:15)
    at Object.subscribeToResult (/Users/jose.sanchez/Documents/shapeletsProjects/@shapelets-cristal-ui/node_modules/rxjs/internal/util/subscribeToResult.js:14:26)
    at SwitchMapSubscriber._innerSub (/Users/jose.sanchez/Documents/shapeletsProjects/@shapelets-cristal-ui/node_modules/rxjs/internal/operators/switchMap.js:65:54)
    at SwitchMapSubscriber._next (/Users/jose.sanchez/Documents/shapeletsProjects/@shapelets-cristal-ui/node_modules/rxjs/internal/operators/switchMap.js:55:14)
    at SwitchMapSubscriber.Subscriber.next (/Users/jose.sanchez/Documents/shapeletsProjects/@shapelets-cristal-ui/node_modules/rxjs/internal/Subscriber.js:66:18)
    at MapSubscriber._next (/Users/jose.sanchez/Documents/shapeletsProjects/@shapelets-cristal-ui/node_modules/rxjs/internal/operators/map.js:55:26)
    at MapSubscriber.Subscriber.next (/Users/jose.sanchez/Documents/shapeletsProjects/@shapelets-cristal-ui/node_modules/rxjs/internal/Subscriber.js:66:18)
    at MapSubscriber._next (/Users/jose.sanchez/Documents/shapeletsProjects/@shapelets-cristal-ui/node_modules/rxjs/internal/operators/map.js:55:26)
    at MapSubscriber.Subscriber.next (/Users/jose.sanchez/Documents/shapeletsProjects/@shapelets-cristal-ui/node_modules/rxjs/internal/Subscriber.js:66:18)
    at Object.complete (/Users/jose.sanchez/Documents/shapeletsProjects/@shapelets-cristal-ui/node_modules/rxjs/internal/observable/forkJoin.js:57:40)
    at Object.wrappedComplete (/Users/jose.sanchez/Documents/shapeletsProjects/@shapelets-cristal-ui/node_modules/rxjs/internal/Subscriber.js:188:76)
    at SafeSubscriber.__tryOrUnsub (/Users/jose.sanchez/Documents/shapeletsProjects/@shapelets-cristal-ui/node_modules/rxjs/internal/Subscriber.js:205:16)
    at SafeSubscriber.complete (/Users/jose.sanchez/Documents/shapeletsProjects/@shapelets-cristal-ui/node_modules/rxjs/internal/Subscriber.js:190:26)
    at Subscriber._complete (/Users/jose.sanchez/Documents/shapeletsProjects/@shapelets-cristal-ui/node_modules/rxjs/internal/Subscriber.js:96:26)
    at Subscriber.complete (/Users/jose.sanchez/Documents/shapeletsProjects/@shapelets-cristal-ui/node_modules/rxjs/internal/Subscriber.js:78:18)
    at /Users/jose.sanchez/Documents/shapeletsProjects/@shapelets-cristal-ui/node_modules/rxjs/internal/util/subscribeToPromise.js:8:24
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
oak-wildwoodcommented, Jul 10, 2020

This is because your workspace has multiple versions of RxJS. RxJS version 1 doesn’t recognize observable from RxJS version 2. If you are using Yarn, you can tell Yarn to use one version of RxJS. The easier way to do with NPM is to delete every other version of RxJS except the root one.

My projects seems to have rxjs@5.5.12 installed under cypress@3.4.1 > listr@0.12.0. But that is a direct dependency of listr. So I’m not quite sure how to delete that one without other things breaking.

Thanks for the quick fix though.

@kpaxton - Did you figure out a workaround? I don’t really understand why this fix isn’t working for me. I’m running nx 9.4.5 so I think it should be included. Currently I see rxjs@5.5.12 installed by cypress@3.8.3 > listr@0.12.0. Seeing as this version of Cypress is included in by nx cli I don’t see how this ever worked for anyone.

EDIT: I was able to get it working by updating to latest (9.5.0-beta.1) and then manually updating cypress to 4.1.0 as it didn’t update it in package.json for some reason. Working now.

1reaction
vsavkincommented, Dec 2, 2019

This is because your workspace has multiple versions of RxJS. RxJS version 1 doesn’t recognize observable from RxJS version 2. If you are using Yarn, you can tell Yarn to use one version of RxJS. The easier way to do with NPM is to delete every other version of RxJS except the root one.

There is a workaround with setting a special symbol that resolves it, but i can only apply it to the builders we own.

Read more comments on GitHub >

github_iconTop Results From Across the Web

You provided an invalid object where a stream was expected ...
I received a similar issue: You provided 'undefined' where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
Read more >
Resolve! TypeError: You provided 'undefined' where a stream ...
TypeError : You provided 'undefined' where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
Read more >
TypeError: You provided an invalid object where a ... - SyntaxFix
TypeError : You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
Read more >
you provided an invalid object where a stream was expected ...
TypeError : You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
Read more >
Angular 9 HTTP Post request Error. You provided 'undefined ...
You can provide an Observable, Promise, Array, or Iterable ... ERROR TypeError: You provided 'undefined' where a stream was expected.
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