angularionic-frameworkionic4bugsnag

event listeners not removed as Ionic 4 & Angular conflicts with BugSnag addEventListener / removeEventListener


Was trying to resolve an issue with non working multiple choice ion-select in my Angular / Ionic 4 app. What I found is that this is combination of BugSnag which I use and ion-select implementation:

function (elm, eventName, cb, opts) {
  elm.removeEventListener(eventName, cb, opts);
}
   function __traceOriginalScript(fn, callbackAccessor) {
      return function () {
        var args = Array.prototype.slice.call(arguments);
        var cba = callbackAccessor(args);
        var cb = cba.get();
        if (typeof cb !== 'function') return fn.apply(this, args);

I believe there is some conflict in the handlers registering/deregistering code yet not sure how to proceed - possibly some fix is required in either Ionic or Bugsnag.


Solution

  • Just found that updating @bugsnag/js to version 6.4.3 solved the issue.