#ngneat/dialog and TypeScript v5.4.5 error calling .open()

5 messages · Page 1 of 1 (latest)

untold whale
#

I'm using the package ngneat/dialog with Angular version 17.3.4 and TypeScript version 5.4.5. Now, before the TypeScript version 5.4.5 everything worked like a charm. After updating to the latest version, an error occurs at multiple places in the Angular application.

The code looks like this:

    this.dialogService.open(AcceptOfferDialogComponent, {
      data: {
        selectedOfferId: selectedOffer[0].tenderId
      },
      width: '100vw'
    }).afterClosed$...

The error I receive is the one attached in the image. However, if I remove the data attribute from the config object, the error disappears. Any solutions?

#

ngneat/dialog and TypeScript v5.4.5 error calling .open()

sonic jackal
#

it seems like you are missing the ref inside the AcceptOfferDialogComponent. like so:

 ref: DialogRef<Data, boolean> = inject(DialogRef);

thats atleast what the error message is telling us here.

untold whale
#

I have the ref in the AcceptOfferDialogComponent:
dialogRef = inject(DialogRef) as DialogRef<AcceptOfferDialogData, DialogResponseData>;

#

That's why I'm so confused