-
-
Notifications
You must be signed in to change notification settings - Fork 86
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 TypeError: Cannot set property '_next' of null #105
Comments
Hi @rodneyrehm, thanks so much for this great bug report, it's really helpful for diagnosing the issue! It looks like the null reference error is a result of the somewhat recent internal change to a linked list for animation processing that was introduced for 2.5.0. It was a significant change that I tested as best as I could, but perhaps something was overlooked! 😅 The stack trace you provided is a bit concerning to me, as |
I could provide the vue component if that helps you, otherwise the significant bits are: to execute the transition I run // create new tweenable, unless element already has an instance
const tweenable = new Tweenable()
if (updateWhileTranisitioning) {
// abort previous mutation (rejecting previous promise)
tweenable.stop(false)
}
const tween = tweenable.tween({
from: _from,
to: _to,
duration,
delay,
easing,
step: _update,
start: _update,
})
tween.then(finishMutation).catch(abortedState => {
// ignore rejection caused by calling .stop(false) on the mutation
}) when a transition finished I run finishMutation () {
tweenable.stop(true)
tweenable.dispose()
} to perform the transition I run (variations of) const _update = state => {
element.style.transform = `translate3d(0px, ${state.y}%, 0px)`
element.style.opacity = state.opacity
} |
The error Is there a reason you went with a double-linked-list instead of going with a simple |
Thank you for posting the sample code! Without being able to run it as posted above, this appears to be a pretty straightforward use case of Shifty. The one thing that is suspect to me is the call to
To be honest, I don't recall giving that option much consideration when I was designing the batched tween processing system. I'm open to exploring that more in a separate Github issue if you think it would be worth changing to! |
I still see the Once the promise returned by After removing the tweenable calls from my Anyway, thank you very much for all your work! :)
Since you already have that implementation I don't think you need to worry about this. I don't think there would be major gains by switching to Set (other than maybe simplifying your code a bit). |
Ahhh I think I see what's happening here now! I think that Thanks for all the info — I will update this issue once I've made some progress on this! |
This is definitely a bug worth fixing. Here's a simplified reproduction of the issue: https://codepen.io/jeremyckahn/pen/qQmQJJ The issue happens when you call |
This is fixed in 2.6.1: https://codepen.io/jeremyckahn/pen/Zmyeyo Please give it a try. Thanks again for reporting and helping to track down this issue, @rodneyrehm! |
Hey there,
thanks for this great library! I'm using Tweenable to run a custom variation of Vue's List Move Transitions and Staggering List Transitions.
I just tried updating from 2.3.1 to 2.6.0 and now see the following errors:
traced to
shifty/src/tweenable.js
Line 196 in 057fc04
traced to
shifty/src/tweenable.js
Line 231 in 057fc04
traced to (after avoiding previous error)
shifty/src/tweenable.js
Line 113 in 057fc04
I applied the following patch locally to prevent above errors from being thrown, but I don't know if this would cause problems elsewhere:
I'm happy to provide a PR for this if you consider the fix sufficient (and you're not quicker at fixing this yourself)
The text was updated successfully, but these errors were encountered: