1

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

mario
  • 186
  • 3
  • 16
  • Might be worthwhile to look at `this.getOptions()`. And if you say that it happens roughly 1 in 10 times, it really sounds like a synchronisation issue (ie something not yet having been loaded etc). – Aldin Bradaric Apr 12 '22 at 12:04
  • I have the same problem in my application. 1 month ago it was working perfectly, now it's random. I can't find any explication. Sometimes it works, sometimes no. – Jordan Noel Apr 28 '22 at 07:58

0 Answers0