Skip to content

RxJS versions compatibility issue: 7.8.1 vs 7.8.2 #670

@solshark

Description

@solshark

Checklist

Description

RxJS versions compatibility issue.

Reproduction

I created nx monorepo project with angular 19.2.
Added @auth0/auth0-angular": "^2.2.3"
Trying to add httpInterceptor according to manual:

import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
import { provideRouter } from '@angular/router';
import { appRoutes } from './app.routes';
import { authHttpInterceptorFn, provideAuth0 } from '@auth0/auth0-angular';
import {
  provideHttpClient,
  withFetch,
  withInterceptors,
} from '@angular/common/http';

export const appConfig: ApplicationConfig = {
  providers: [
    provideHttpClient(withFetch(), withInterceptors([authHttpInterceptorFn])),
    provideAuth0({
      domain: 'dev-******.com',
      clientId: '********',
      authorizationParams: {
        redirect_uri: window.location.origin,
      },
      httpInterceptor: {
        allowedList: ['/api'],
      },
    }),
    provideZoneChangeDetection({ eventCoalescing: true }),
    provideRouter(appRoutes),
  ],
};

This sample gives me an error:

✘ [ERROR] TS2328: Types of parameters 'handle' and 'next' are incompatible.
  Call signature return types 'Observable<HttpEvent<unknown>>' and 'Observable<HttpEvent<unknown>>' are incompatible.
    The types of 'source' are incompatible between these types.
      Type 'import("/Users/solshark/Development/**/node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable").Observable<any> | undefined' is not assignable to type 'import("/Users/solshark/Development/**/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/types/internal/Observable").Observable<any> | undefined'.
        Type 'import("/Users/solshark/Development/**/node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable").Observable<any>' is not assignable to type 'import("/Users/solshark/Development/**/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/types/internal/Observable").Observable<any>'.
          Types of property 'operator' are incompatible.
            Type 'import("/Users/solshark/Development/**/node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Operator").Operator<any, any> | undefined' is not assignable to type 'import("/Users/solshark/Development/**/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/types/internal/Operator").Operator<any, any> | undefined'.
              Type 'import("/Users/solshark/Development/**/node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Operator").Operator<any, any>' is not assignable to type 'import("/Users/solshark/Development/**/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/types/internal/Operator").Operator<any, any>'.
                Types of property 'call' are incompatible.
                  Type '(subscriber: import("/Users/solshark/Development/**/node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Subscriber").Subscriber<any>, source: any) => import("/Users/solshark/Development/**/node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/types").TeardownLogic' is not assignable to type '(subscriber: import("/Users/solshark/Development/**/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/types/internal/Subscriber").Subscriber<any>, source: any) => import("/Users/solshark/Development/**/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/types/internal/types").TeardownLogic'.
                    Types of parameters 'subscriber' and 'subscriber' are incompatible.
                      Type 'import("/Users/solshark/Development/**/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/types/internal/Subscriber").Subscriber<any>' is not assignable to type 'import("/Users/solshark/Development/**/node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Subscriber").Subscriber<any>'.
                        Property 'isStopped' is protected but type 'Subscriber<T>' is not a class derived from 'Subscriber<T>'. [plugin angular-compiler]

    apps/portal/src/app/app.config.ts:13:53:
      13 │ ...ttpClient(withFetch(), withInterceptors([authHttpInterceptorFn])),
         ╵                                             ~~~~~~~~~~~~~~~~~~~~~

Additional context

No response

auth0-angular version

2.2.3

Angular version

19.2

Which browsers have you tested in?

Safari

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis points to a verified bug in the code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions