In my development setup, I work with two repositories known as web-common
and A-frontend
. Typically, I use npm link web-common
from within A-frontend
. Both repositories share various dependencies such as React, Typescript, Google Maps, MobX, etc. Up until recently, this workflow has been seamless for me. However, after introducing RxJS, I started encountering errors like the following:
TS2345: Argument of type 'import("/Users/fharvey/code/monolith/A-frontend/node_modules/rxjs/internal/types").OperatorFunction<import("/Users/fharvey/code/monolith/web-common/services/scaffold/replay_pb").ReplayAllMessagesResult, import("/Users/fharvey/code/monolith/A-frontend/src/app/components/pages/RobotReporting/index").TypeSiloCollec...' is not assignable to parameter of type 'import("/Users/fharvey/code/monolith/web-common/node_modules/rxjs/internal/types").OperatorFunction<import("/Users/fharvey/code/monolith/web-common/services/scaffold/replay_pb").ReplayAllMessagesResult, import("/Users/fharvey/code/monolith/A-frontend/src/app/components/pages/RobotReporting/index").TypeSiloCollecti...'.
Types of parameters 'source' and 'source' are incompatible.
This essentially points out that
~"A-frontend/node_modules/rxjs/internal/types".OperatorFunction
does not match with ~"web-common/node_modules/rxjs/internal/types".OperatorFunction
. While there are resources addressing this issue:
The tricky part here is that this discrepancy only occurs in my production build, not in the development environment.
Common Webpack Configuration
// Includes common webpack configuration settings
// To be filled in later...
Development Webpack Configuration
// Contains webpack settings specific to the development environment
// To be completed soon...
Production Webpack Configuration
// Consists of webpack configurations tailored for production deployment
// More details coming shortly...
tsconfig Setup
// Displaying the tsconfig file contents for reference
// Stay tuned for more information...
I have shared a lot of information above, as I am currently puzzled by these issues and wanted to provide all relevant details. Notably, I do not utilize any import ... from "rxjs/internal"
, yet it seems to be happening behind the scenes. This behavior is unique to RxJS and has not occurred with any other dependency. I tried installing web-common
directly instead of linking it, but unfortunately, that did not resolve the problem.