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

Uncaught promise error in 1.1.0 #255

Open
benjaminrancourt opened this issue Oct 30, 2019 · 13 comments
Open

Uncaught promise error in 1.1.0 #255

benjaminrancourt opened this issue Oct 30, 2019 · 13 comments

Comments

@benjaminrancourt
Copy link

Hi,

Firstly, I want to thank you for your library, it adds a nice touch to our application.
As I am a developer, it's sometime nice when we know how our creation is used, so I've attached a partial screenshot to show to you our use case.

Secondly, I encouters a little issue since I've upgrade progressbar.js from 1.0.1 to 1.1.0.
In my browser console, there is sometime one or multiple uncaught promise errors:

Uncaught (in promise) {offset: 289.0670000019968}
Promise.then (async)		
animate	@	progressbar.js:1183
animate	@	progressbar.js:1406

It does'nt seem to affect the UI. Unfortunatly, I have not been able to find exactly why it occurs.

By by looking into the diffs from 1.0.1 to 1.1.0,
I have been able to find that the error may be caused since the upgrade of the shifty dependency from the Pull Request #196 (commit).

By adding an empty catch function to R118-R121, the promise error is handled and it seem to not affect the UI. But, I'm not sure that it is the right way to fix this problem...

.catch(function(state) {})

I hope it helps you, thank you very much!


Screenshot_2019-10-30_13-43-15

@kimmobrunfeldt
Copy link
Owner

Thanks for reporting. Let's see if this is related to #256

@Yahav
Copy link

Yahav commented Dec 28, 2019

Will you please just catch it until you'll figure it out? its really hazardous..

@asc0910
Copy link

asc0910 commented Jan 31, 2020

No solution yet?

@GianluigiMemoli
Copy link

Same problem here!

@dmarman
Copy link

dmarman commented Mar 21, 2020

Thanks for the fix. Here the command for installing from the commit:

npm install --save "git://github.com/Zellerich/progressbar.js.git#0978bd7a45c1e1fcc8cf9b0890caddb5362941f6

@kimmobrunfeldt
Copy link
Owner

Can you test the latest progressbar.js from latest master?

I think this should work similarly as @dmarman commented before:

npm install --save "git://github.com/kimmobrunfeldt/progressbar.js.git#master

@wparad
Copy link

wparad commented May 12, 2020

The root cause of the problem is that animate calls shifty tween multiple times before the previous animation is completed. Shifty expects the client to never do that, but progressbar.js doesn't put any protection in place. Part of the reason is because the error message and documentation aren't clear why that is happening (improvement here: jeremyckahn/shifty#115)

The solution is to make sure to await progress.stop(true) (or await circle.stop(true)) the animation before animating again.

@jeremyckahn
Copy link
Contributor

FYI, I have incorporated @wparad's jeremyckahn/shifty#115 fix into the latest v.2.9.0 release.

Thank you @wparad!

@mihaighigea
Copy link

Is there any timeframe for having this issue solved?

calvinps pushed a commit to calvinps/ember-progress-bar that referenced this issue May 27, 2020
@the-turk
Copy link

the-turk commented Jul 25, 2020

FYI, I have incorporated @wparad's jeremyckahn/shifty#115 fix into the latest v.2.9.0 release.

Thank you @wparad!

Now I'm having the stop() executed while tween isPlaying. error. Thanks wparad for changing the error mesage for us.

Is this repository abandoned?

@jeremyckahn
Copy link
Contributor

Just to get some clarity on the previous two comments, were they directed at @kimmobrunfeldt or myself?

@the-turk
Copy link

Just to get some clarity on the previous two comments, were they directed at @kimmobrunfeldt or myself?

Mine was directed to progressbar.js so it's @kimmobrunfeldt

@cardioprint
Copy link

As a temporary workaround, you can set option duration for animate() to almost zero time

mtorromeo added a commit to mtorromeo/progressbar.js that referenced this issue Oct 6, 2021
Catch "uncaught in promise"-error that is thrown when animate function is called while an animation is still running.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests