nativescript-community / ui-lottie

NativeScript plugin to expose Airbnb Lottie
https://github.com/airbnb/lottie-android
Other
177 stars 57 forks source link

iOS: unhandled promise rejection #27

Closed NathanWalker closed 6 years ago

NathanWalker commented 6 years ago

When using with Angular binding the following uncaught rejection can happen (even though it's not a problem but can cause strange app behavior to follow):

CONSOLE ERROR file:///app/vendor.js:69564:30: Unhandled Promise rejection: The iOS lottie view isn't loaded yet. ; Zone: <root> ; Task: null ; Value: Error: The iOS lottie view isn't loaded yet. file:///app/vendor.js:71016:33 [<root>]
ZoneAwarePromise@file:///app/vendor.js:69790:37 [<root>]
playAnimation@file:///app/vendor.js:71009:27 [<root>]
file:///app/vendor.js:70980:35 [<root>]
applyAllNativeSetters@file:///app/vendor.js:99752:28 [<root>]
initNativeView@file:///app/vendor.js:99696:30 [<root>]
onResumeNativeUpdates@file:///app/vendor.js:100556:36 [<root>]
_resumeNativeUpdates@file:///app/vendor.js:100201:39 [<root>]
onLoaded@file:///app/vendor.js:100160:34 [<root>]
onLoaded@file:///app/vendor.js:70990:39 [<root>]
file:///app/vendor.js:100240:98 [<root>]
callFunctionWithSuper@file:///app/vendor.js:100233:13 [<root>]
callLoaded@file:///app/vendor.js:100240:35 [<root>]
loadView@file:///app/vendor.js:100368:28 [<root>]
file:///app/vendor.js:100162:27 [<root>]
eachChildView@file:///app/vendor.js:108943:34

PR coming to seamlessly handle and avoid this issue.

lambourn commented 6 years ago

@bradmartin would be cool if you could publish 2.1.1 to npmjs, we're facing the same issue here

bradmartin commented 6 years ago

@lambourn done 👍

zeesulehria commented 5 years ago

@bradmartin I am still seeing this error with NS 5, Angular 7 and "nativescript-lottie": "^2.1.2"

ERROR Error: Uncaught (in promise): Error: The iOS lottie view isn't loaded yet.
file:///app/tns_modules/nativescript-lottie/nativescript-lottie.js:130:33 [angular]
ZoneAwarePromise@file:///app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:902:37 [angular]
playAnimation@file:///app/tns_modules/nativescript-lottie/nativescript-lottie.js:123:27 [angular]
playAnimation@file:///app/home/mainActivity/mainActivity.component.js:199:43 [angular]
handleAnimationChange@file:///app/home/mainActivity/mainActivity.component.js:136:35 [angular]
ngOnChanges@file:///app/home/mainActivity/mainActivity.component.js:127:35 [angular]
checkAndUpdateDirectiveInline@file:///app/tns_modules/@angular/core/bundles/core.umd.js:18560:34 [angular]
debugCheckAndUpdateNode@file:///app/tns_modules/@angular/core/bundles/core.umd.js:20424:47 [angular]
debugCheckDirectivesFn@file:///app/tns_modules/@angular/core/bundles/core.umd.js