Skip to content

Property 'currentObservers' is missing in type rxjs #7145

@baronkoko

Description

@baronkoko

Describe the bug

A typescript error occurs when using the Subject as a type. Can someone help with this, please?

Argument of type '(subscription: Subject<void>) => void' is not assignable to parameter of type '(value: { closed: boolean; observers: { next: (value: void) => void; error: (err: any) => void; complete: () => void; }[]; isStopped: boolean; hasError: boolean; thrownError: any; lift: <R>(operator: Operator<void, R>) => Observable<...>; ... 11 more ...; toPromise: { ...; }; }, index: number, array: { ...; }[]) => ...'.
  Types of parameters 'subscription' and 'value' are incompatible.
    Property 'currentObservers' is missing in type '{ closed: boolean; observers: { next: (value: void) => void; error: (err: any) => void; complete: () => void; }[]; isStopped: boolean; hasError: boolean; thrownError: any; lift: <R>(operator: Operator<void, R>) => Observable<...>; ... 11 more ...; toPromise: { ...; }; }' but required in type 'Subject<void>'.

image

Expected behavior

When using the Subject as a type, typescript errors should not occur

Reproduction code

No response

Reproduction URL

https://stackblitz.com/edit/nuxt-starter-hvcakf?file=app.vue

Version

7.8.0

Environment

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions