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.

Quick Fixes for Common Problems

See original GitHub issue

Multiple Versions of RxJS or WebPack

Having multiple versions of RxJS or WebPack in your node_modules can result in hard-to-troubleshoot problems. Example: https://github.com/nrwl/nx/issues/2421.

If you are using the Nx command (e.g., you invoke nx build myproj), even when Nx simply delegates to the Angular CLI, we try to work around the issues, but it’s not a 100% guarantee that they won’t appear. The only guarantee is to have one version of RxJS in node_modules.

  1. Make sure your package.json depends on the same version as @nrwl/workspace.
  2. If it didn’t help: 2a: If you are using yarn, add the following to your package.json:
"resolutions": {
  "rxjs": "6.4.0" // set to whatever version you want
}

2b: if you are using npm, add the following to your package.json:

"resolutions": {
  "rxjs": "6.4.0" // set to whatever version you want
}

and the following to your devDepencecies:

"npm-force-resolutions": "0.0.3"

And add the following postinstall script:

"scripts": {
  "preinstall": "npx npm-force-resolutions"
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:9
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
edbzncommented, Sep 29, 2021

@wrslatz The problem is not related to RxJS directly but how NPM/Yarn resolves multiple versions of the same installed package, you can find more details here.

1reaction
wrslatzcommented, Sep 29, 2021

Thanks @edbzn! That makes sense from the npm side. I wonder why we run into so many issues with rxjs specifically though (we usually hit tsc compile errors where the types of the two different versions mismatch for the same object, like Observable).

Maybe it has to do with how complex the types in rxjs are. Besides forcing module resolutions, are there any recommended best practices to keep a library you maintain compatible with multiple rxjs versions? Not sure if depenencies vs peerDependencies for rxjs and semver specificity matter.

Read more comments on GitHub >

github_iconTop Results From Across the Web

15 Quick Fixes for Common Home Problems - HGTV
Give Your Toilet Flush More Gush · Keep the Heat on Exposed Indoor Pipes During Cold Weather · Banish Musty Front-Load Washer Smells...
Read more >
27 Instant Fixes For Nagging Problems Around the House
Super-simple solutions for common household headaches. · Cleaner Clothes · Stop Washing Machine Walk · If the A/C Isn't Working · Appliance Touch-Up ......
Read more >
5 Simple Fixes for Most Computer Problems - Lifewire
Try these five easy fixes for most computer problems before you pay for ... Often times, virus-caused problems appear as general computer ...
Read more >
5 Fast-Fixes For Common Health Problems | realbuzz.com
5 Fast-Fixes For Common Health Problems ; 1. Bloating ; 2. Anxiety ; 3. Hay fever ; 4. Dandruff ; 5. Insomnia.
Read more >
11 Easy DIY Fixes for Annoying House Problems - Bob Vila
11 Easy DIY Fixes for Annoying House Problems · Rapid Repairs · Running Toilet · Damaged Screens · Filling In Picture Holes ·...
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