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.

e2e tests fails when rxjs is introduced to project

See original GitHub issue

Expected Behavior

Running e2e tests should open cypress.

Current Behavior

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

Failure Information (for bugs)

I suspect that it is due to some internal configuration of how cypress is being incorporated. I only have dependencies installed I don’t use them and e2e tests won’t run.

Steps to Reproduce

git clone git@github.com:urosappdev/nx-js-bug.git

  1. nx run e2e booking-e2e

Context

package.json

{
  "name": "tp",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "nx": "nx",
    "start": "nx serve",
    "build": "nx build",
    "test": "nx test",
    "lint": "nx workspace-lint && nx lint",
    "e2e": "nx e2e",
    "affected:apps": "nx affected:apps",
    "affected:libs": "nx affected:libs",
    "affected:build": "nx affected:build",
    "affected:e2e": "nx affected:e2e",
    "affected:test": "nx affected:test",
    "affected:lint": "nx affected:lint",
    "affected:dep-graph": "nx affected:dep-graph",
    "affected": "nx affected",
    "format": "nx format:write",
    "format:write": "nx format:write",
    "format:check": "nx format:check",
    "workspace-schematic": "nx workspace-schematic",
    "dep-graph": "nx dep-graph",
    "help": "nx help"
  },
  "private": true,
  "dependencies": {
    "@nestjs/common": "^6.2.4",
    "@nestjs/core": "^6.2.4",
    "@nestjs/platform-express": "^6.2.4",
    "document-register-element": "1.13.1",
    "react": "16.9.0",
    "react-dom": "16.9.0",
    "react-router-dom": "5.0.1",
    "reflect-metadata": "^0.1.12",
    "rxfire": "^3.8.2",
    "rxjs": "^6.5.3",
    "styled-components": "4.3.2"
  },
  "devDependencies": {
    "@babel/preset-react": "7.0.0",
    "@nestjs/schematics": "^6.3.0",
    "@nestjs/testing": "^6.2.4",
    "@nrwl/cypress": "8.5.1",
    "@nrwl/eslint-plugin-nx": "8.5.1",
    "@nrwl/jest": "8.5.1",
    "@nrwl/nest": "^8.5.1",
    "@nrwl/node": "8.5.1",
    "@nrwl/react": "^8.5.1",
    "@nrwl/web": "8.5.1",
    "@nrwl/workspace": "8.5.1",
    "@testing-library/react": "8.0.5",
    "@types/jest": "24.0.9",
    "@types/node": "~8.9.4",
    "@types/react": "16.9.1",
    "@types/react-dom": "16.8.5",
    "@types/react-router-dom": "4.3.5",
    "@types/styled-components": "4.1.18",
    "@typescript-eslint/eslint-plugin": "2.0.0-alpha.4",
    "@typescript-eslint/parser": "2.0.0-alpha.4",
    "cypress": "3.4.1",
    "dotenv": "6.2.0",
    "eslint": "6.1.0",
    "eslint-config-prettier": "6.0.0",
    "eslint-plugin-import": "2.18.2",
    "eslint-plugin-jsx-a11y": "6.2.3",
    "eslint-plugin-react": "7.14.3",
    "eslint-plugin-react-hooks": "1.6.1",
    "jest": "24.1.0",
    "prettier": "1.18.2",
    "ts-jest": "24.0.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~3.4.5"
  }
}

Please provide any relevant information about your setup:

  • version of Nx used: 8.5.1
  • 3rd-party libraries and their versions
 "rxfire": "^3.8.2",
 "rxjs": "^6.5.3",
  • and most importantly - a use-case that fails

Running e2e tests fails.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
vsavkincommented, Dec 3, 2019

I have an update.

Talked to Ben Lesh and apparently the following fixes it: https://github.com/nrwl/nx/commit/a88ee635781e919779a0bad6ad43e97aa37a3d16

I’ll cut a release today with the fix.

I’m going to close this issue.

0reactions
trumbittacommented, Nov 19, 2019

Update: it worked once I found out resolutions is a yarn thing and I used yarn install.

@vsavkin The resolutions fix doesn’t work for me. I thought the culprit was redux-observable (the only RxJS related dependency I can think of), but the error still shows up if I remove it then rm -rf node_modules package-lock.json && npm i && npm run affected:e2e.

Full deps:

  "dependencies": {
    "@nestjs/common": "^6.10.1",
    "@nestjs/core": "^6.10.1",
    "@nestjs/platform-express": "^6.10.1",
    "@nestjs/typeorm": "^6.2.0",
    "document-register-element": "1.13.1",
    "formik": "^2.0.4",
    "react": "16.10.2",
    "react-dom": "16.10.2",
    "react-redux": "^7.1.3",
    "react-router-dom": "^5.1.2",
    "redux-devtools-extension": "^2.13.8",
    "redux-observable": "^1.2.0",
    "redux-persist": "^6.0.0",
    "redux-starter-kit": "^1.0.1",
    "reflect-metadata": "^0.1.13",
    "rxjs": "^6.5.3",
    "sqlite3": "^4.1.0",
    "styled-components": "4.4.0",
    "typeorm": "^0.2.20"
  },
  "devDependencies": {
    "@babel/preset-react": "7.0.0",
    "@nestjs/schematics": "^6.7.3",
    "@nestjs/testing": "^6.10.1",
    "@nrwl/cli": "^8.7.1",
    "@nrwl/cypress": "8.7.1",
    "@nrwl/eslint-plugin-nx": "8.7.1",
    "@nrwl/jest": "8.7.1",
    "@nrwl/nest": "^8.7.1",
    "@nrwl/node": "8.7.1",
    "@nrwl/react": "8.7.1",
    "@nrwl/web": "8.7.1",
    "@nrwl/workspace": "8.7.1",
    "@testing-library/react": "9.3.0",
    "@types/jest": "24.0.9",
    "@types/node": "~8.9.4",
    "@types/react": "16.9.6",
    "@types/react-dom": "16.9.2",
    "@types/react-redux": "^7.1.5",
    "@types/react-router-dom": "^5.1.2",
    "@types/styled-components": "4.1.19",
    "@typescript-eslint/eslint-plugin": "2.3.2",
    "@typescript-eslint/parser": "2.3.2",
    "commitizen": "^4.0.3",
    "cypress": "3.4.1",
    "cz-conventional-changelog": "^3.0.2",
    "dotenv": "6.2.0",
    "eslint": "6.1.0",
    "eslint-config-prettier": "6.0.0",
    "eslint-plugin-import": "2.18.2",
    "eslint-plugin-jsx-a11y": "6.2.3",
    "eslint-plugin-react": "7.16.0",
    "eslint-plugin-react-hooks": "2.1.2",
    "jest": "24.1.0",
    "prettier": "1.18.2",
    "rollup": "^1.27.2",
    "ts-jest": "24.0.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~3.4.5"
  },
  "resolutions": {
    "rxjs": "6.5.3",
    "rxjs-compat": "6.5.3"
  },
Read more comments on GitHub >

github_iconTop Results From Across the Web

Since Angular 11.0.3, e2e tests produce error - Stack Overflow
Since 11.0.3 angular/core version, E2E tests are not working on a project with the default configuration.
Read more >
Why and How to unit test angular applications - Halodoc Blog
The objective of this blog is to provide a complete understanding of why unit testing is important, how to set up your Angular...
Read more >
Introduction to E2E Testing with the Angular CLI and Protractor
Our E2E test is using Jasmine. We first describe our E2E test. Then we import our Page Object class to use and create...
Read more >
Testing Angular Services: A Walk-Through With Examples
If your project is starting to get testing under control, services are a great place ... import { map, catchError } from 'rxjs/operators';....
Read more >
ng test - Angular
Option Description Value Type Defau... ‑‑browsers Override which browsers tests are run against. string ‑‑code‑coverage Output a code coverage report. boolean false ‑‑code‑coverage‑exclude Globs to exclude...
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