nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.26k stars 2.32k forks source link

RxJs mismatch issues in DataPersistance keep coming back #2421

Closed evtk closed 4 years ago

evtk commented 4 years ago

Expected Behavior

I can run an upgrade of NX with npm run update, without getting issues with dataPersistance.

Current Behavior

I have spent a lot of time to get the issues I had with RxJS version mismatch solved. See this topic: https://github.com/nrwl/nx/issues/1416#issuecomment-535462018.

Now it has been a while since I had the time to upgrade NX. So coming from "@nrwl/angular": "8.6.0" I am updating to "@nrwl/angular": "8.12.1". But as soon this upgrade is done, I get the same RxJS related errors.

Failure Information (for bugs)

My RxJS version is pinned to 6.5.3. After running the update I get these types of errors:

Type 'Observable<MyAction>' is not assignable to type 'void | Action | Observable<Action>'. Type 'Observable<MyAction>' is not assignable to type 'Observable<Action>'. Types of property 'source' are incompatible. Type 'import("/Users/evtk/Documents/git/my.repo/client/angular/node_modules/rxjs/internal/Observable").Observable<any>' is not assignable to type 'import("/Users/evtk/Documents/git/my.repo/client/angular/node_modules/@nrwl/angular/node_modules/rxjs/internal/Observable").Observable<any>'.

So then I decided to downgrade to the 6.4.0 version of RxJS. This is unwanted, because I have another package explicitly asking for 6.5.3, but just to make sure. After downgrading to RxJS 6.4.0 I have checked my package-lock file and it doesn't contain any references to RxJS 6.5.3. anymore. Now I can build my app, but as soon as I serve it, I get these type of errors again:

... dispatched an invalid action: {"_isScalar":false,"source"

Steps to Reproduce

I can't share my repo because it contains corporate code, but here is my package.json after just running the npm update. I feel that there should be no need to downgrade RxJS.

"dependencies": {
    "@angular/animations": "8.2.8",
    "@angular/cdk": "8.2.0",
    "@angular/common": "8.2.8",
    "@angular/compiler": "8.2.8",
    "@angular/core": "8.2.8",
    "@angular/forms": "8.2.8",
    "@angular/platform-browser": "8.2.8",
    "@angular/platform-browser-dynamic": "8.2.8",
    "@angular/router": "8.2.8",
    "@ngrx/effects": "8.4.0",
    "@ngrx/entity": "8.4.0",
    "@ngrx/router-store": "8.4.0",
    "@ngrx/store": "8.4.0",
    "@nrwl/angular": "8.12.1",
    "@sitecore-jss/sitecore-jss": "13.0.0",
    "@sitecore-jss/sitecore-jss-angular": "13.0.0",
    "core-js": "2.5.4",
    "ibantools": "2.0.0",
    "luxon": "1.19.3",
    "merge": "1.2.1",
    "pikaday": "1.8.0",
    "rxjs": "6.5.3",
    "zone.js": "0.9.1"
  },
"devDependencies": {
    "@angular-devkit/build-angular": "0.803.3",
    "@angular/cli": "8.3.3",
    "@angular/compiler-cli": "8.2.8",
    "@angular/language-service": "8.2.8",
    "@ngrx/schematics": "8.4.0",
    "@ngrx/store-devtools": "8.4.0",
    "@nrwl/cypress": "8.12.1",
    "@nrwl/jest": "8.12.1",
    "@nrwl/workspace": "8.12.1",
    "@sitecore-jss/sitecore-jss-dev-tools": "13.0.0",
    "@types/jest": "24.0.9",
    "@types/luxon": "1.15.2",
    "@types/node": "8.9.4",
    "codelyzer": "5.0.1",
    "cypress": "3.8.2",
    "dotenv": "6.2.0",
    "eslint": "6.1.0",
    "istanbul": "0.4.5",
    "jest": "24.9.0",
    "jest-junit": "8.0.0",
    "jest-preset-angular": "7.0.0",
    "ng-mocks": "8.0.0",
    "npm-run-all": "4.1.5",
    "prettier": "1.19.1",
    "ts-jest": "24.0.0",
    "ts-node": "7.0.1",
    "tslint": "5.11.0",
    "tslint-defocus": "2.0.6",
    "typescript": "3.5.3",
    "vsts-coverage-styles": "^1.0.8"
  }
andreaswilli commented 4 years ago

I experience the exact same issue (@nrwl/angular version 8.12.2): After downgrading rxjs to 6.4.0 I get this:

... dispatched an invalid action: {"_isScalar":false,"source"

vsavkin commented 4 years ago

It's a common problem with having more than one version of RxJS. Could you try the following: https://github.com/nrwl/nx/issues/2458

evtk commented 4 years ago

@vsavkin your fix with npm resolutions worked. After updating to NX 9, it seems it works even without it. I'll close this one up.

github-actions[bot] commented 1 year ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.