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 - Velocity & jQuery 1.4.2 - Cannot read property 'tweensContainer' of undefined #118

Closed
raphaelrauwolf opened this issue Jun 20, 2014 · 2 comments

Comments

@raphaelrauwolf
Copy link

When Velocity is used with jQuery 1.4.2 and you want to fade out an element, the browser throws the error Cannot read property 'tweensContainer' of undefined. This error is thrown, because the Data Cache has not been initiated. The reason for that is, that in the earlier jQuery Versions, $.data(element, NAME) would be null instead of undefined.

In line 1545, where you check if the Data Cache has been initiated, you additionally have to check if the data object is null.

//jQuery 1.11.1
$.data($('body'),'velocity'); // undefined

//jQuery 1.4.2
$.data($('body'),'velocity'); // null
@julianshapiro
Copy link
Owner

Hey Raphael. Thank you so much for doing the research and pinpointing this issue.

As per the package.json (https://github.com/julianshapiro/velocity/blob/master/package.json), Velocity explicitly supports 1.4.3 and up. But, I'm going to make this tweak now and see if this was the only issue preventing Velocity from working on 1.4.2! Stay tuned.

You are awesome. Thanks again.

@julianshapiro
Copy link
Owner

Ok, so while addressing this issue does solve the problem, jQuery below 1.4.3 has unsolved IE8-related CSS bugs. So, I cannot recommend using below 1.4.3 in any circumstance -- but at least Velocity doesn't error out now in these older versions.

Rycochet pushed a commit that referenced this issue Aug 3, 2020
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

2 participants