progressbar.js
progressbar.js copied to clipboard
Uncaught promise error in 1.1.0
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!
Thanks for reporting. Let's see if this is related to https://github.com/kimmobrunfeldt/progressbar.js/issues/256
Will you please just catch it until you'll figure it out? its really hazardous..
No solution yet?
Same problem here!
Thanks for the fix. Here the command for installing from the commit:
npm install --save "git://github.com/Zellerich/progressbar.js.git#0978bd7a45c1e1fcc8cf9b0890caddb5362941f6
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
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: https://github.com/jeremyckahn/shifty/pull/115)
The solution is to make sure to await progress.stop(true)
(or await circle.stop(true)
) the animation before animating again.
FYI, I have incorporated @wparad's jeremyckahn/shifty#115 fix into the latest v.2.9.0 release.
Thank you @wparad!
Is there any timeframe for having this issue solved?
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?
Just to get some clarity on the previous two comments, were they directed at @kimmobrunfeldt or myself?
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
As a temporary workaround, you can set option duration
for animate()
to almost zero time