Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Animation cancelled after host component destroy #68

Open
wanpeng2008 opened this issue Jul 26, 2018 · 2 comments
Open

Error: Animation cancelled after host component destroy #68

wanpeng2008 opened this issue Jul 26, 2018 · 2 comments
Labels

Comments

@wanpeng2008
Copy link

wanpeng2008 commented Jul 26, 2018

I implement an auto running slider using setInterval()

    ngAfterViewInit(): void {
        this.interval = setInterval(()=>{
            this.topSliderComponent.nextSlide().then();
        }, 5000);

    }
    ngOnDestroy(): void {
        clearInterval(this.interval);
    }

When i route to other pages, "Animation cancelled" errors are thrown again and again.

CONSOLE ERROR file:///app/tns_modules/@angular/core/bundles/core.umd.js:1686:28: ERROR Error: Uncaught (in promise): Error: Animation cancelled.
_rejectAnimationFinishedPromise@file:///app/tns_modules/tns-core-modules/ui/animation/animation-common.js:100:31 [<root>]
animationFinishedCallback@file:///app/tns_modules/tns-core-modules/ui/animation/animation.js:148:57 [<root>]
animationDidStopFinished@file:///app/tns_modules/tns-core-modules/ui/animation/animation.js:70:35 [<root>]
UIApplicationMain@[native code] [<root>]
start@file:///app/tns_modules/tns-core-modules/application/application.js:264:26 [<root>]
run@file:///app/tns_modules/tns-core-modules/application/application.js:284:10 [<root>]
bootstrapNativeScriptApp@file:///app/tns_modules/nativescript-angular/platform-common.js:157:26 [<root>]
bootstrapApp@file:///app/tns_modules/nativescript-angular/platform-common.js:91:38 [<root>]
bootstrapModule@file:///app/tns_modules/nativescript-angular/platform-common.js:80:26 [<root>]
anonymous@file:///app/main.js

What shall i do to eliminate this error?

@JoshDSommer
Copy link
Owner

I think this can be fixed by going through and updating all the animation promises to have a catch event.

animation.then(_ => {}, (err) => {});

I'll try to get to it here soon, but if you want to open a PR please feel free. Thanks

@alqabali
Copy link

any fix for that issue? @TheOriginalJosh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants