airbnb/lottie-web

String: TypeError: null is not an object (evaluating 'S.onComplete')

vorderpneu opened this issue · 1 comments

We use lottie-web in an Ionic app with Angular and ngrx-lottie to display an animation. For some time now, we have been seeing the following error in our error logs:

String: TypeError: null is not an object (evaluating 'S.onComplete')
    postMessage@webpack:///node_modules/lottie-web/build/player/esm/lottie_light.min.js:424:28
    We@webpack:///node_modules/zone.js/fesm2015/zone.js:755:44
    runTask@webpack:///node_modules/zone.js/fesm2015/zone.js:173:57
    invokeTask@webpack:///node_modules/zone.js/fesm2015/zone.js:483:41
    O@webpack:///node_modules/zone.js/fesm2015/zone.js:1631:24
    N@webpack:///node_modules/zone.js/fesm2015/zone.js:1674:43

The error occurs here:

process.onComplete(data.payload);

What is the reason that process can be null, and what would be the best way to handle this error properly?

Only iPhones and MacBooks are affected. Unfortunately, we have not been able to reproduce it on our own devices.

Browsers:
Mobile Safari UI/WKWebView
Apple Mail 605.1

OS Versions:
iOS 15.6
iOS 15.7
iOS 15.8
iOS 16.3
iOS 16.7
iOS 17.5
Mac OS X 10.15

@neehhaa06 Yes, i already tried those two suggestions, but the error is still handled by the zone.js globalCallback error and that's why the angular app still doesn't know about those errors. Yes, i could override window.onerror to handle the error, but i want to avoid that.

My idea is to have an ErrorEvent similar to e.g. BMRenderFrameErrorEvent so that I can handle the Error in the Angular app