ToastrService sometimes throw cannot read properties of undefined (reading 'toastId')

481 views Asked by At

as described in the title. I have a strange problem with toastrservice from ngx-toastr library. In only one of my modals sometimes it throws an error

 cannot read properties of undefined (reading 'toastId')

the function that cause this is

 public showSuccessAlert(messageKey: string, params?: object, customOptions?: Partial<IndividualConfig>) {

    const message = this.translateService.instant(messageKey);
    this.toastr.success(message, '', this.getOptions(customOptions));
  }

I'm using it in whole app, every modal and the problem exists only in one of them. Morevoer it happens only on the server (1 for 10 tries more or less), locally I cannot reproduce this issue. What can be the problem? I couldn't find any issue regarding this problem on the Internet

0

There are 0 answers