Closed
Conversation
## Problem auth0-angular directly imports from `rxjs` and exposes RxJS types (`Observable`) in its public API, but doesn't declare RxJS as a dependency. This causes TypeScript errors in monorepos with strict package managers (pnpm, Yarn PnP) when multiple RxJS versions exist. ## Root Cause Without declaring RxJS as a peer dependency, package managers don't know that auth0-angular requires RxJS to be present and should dedupe it with the app's RxJS version. In pnpm's strict isolation mode, this allows multiple RxJS versions to coexist, causing type incompatibilities at API boundaries (interceptors, guards). ## Solution Add RxJS as a peer dependency with the same version range that Angular itself uses (`^6.5.3 || ^7.4.0`). This ensures: - Package managers know auth0-angular needs RxJS - They dedupe to a single version shared across the app - Type compatibility at API boundaries ## Testing Reproduced the issue in a fresh Nx monorepo with pnpm: - ✅ Without peer dependency: TypeScript errors with dual RxJS versions - ✅ With peer dependency: Builds successfully with single RxJS version Fixes #670 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
Author
|
Closing as this turned out to be a monorepo setup issue rather than an SDK bug. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
@auth0/auth0-angularimports fromrxjsand exposes RxJS types (Observable) in its public API, but does not declare RxJS as a peer dependency. In strict package managers (pnpm, Yarn PnP), this allows multiple RxJS versions to coexist, causing TypeScript type incompatibilities at API boundaries (interceptors, guards).Solution
Add
rxjsas a peer dependency with the same version range that@angular/coreuses (^6.5.3 || ^7.4.0). This ensures package managers dedupe to a single RxJS version shared with the app.Impact
@angular/core,@angular/common,@angular/router,@ngrx/store, etc. all declare RxJSTesting
All 131 tests pass.
Fixes #670