Jump to content
Search Community

MorphSVG 18.2 & Arrays of jQuery Elements fail

Ninili test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

I just replaced the first MorphSVG plugin with the new version (0.8.1) and my morphed animations failed with the error "cannot read property 'toUpperCase' of undefined".
When I debugged this in the non-minimized version, I found that the problem might be arrays of jQuery-Elements:
I think this is because the jQuery element is put into an array in this line of code:

(MorphSVGPlugin.js, _parseShape function, Line 847)

e = isString ? TweenLite.selector(shape) : [shape]

Then later, it is pulled out of this array:

(MorphSVGPlugin.js, _parseShape function, Line 848)

if (e && e[0]) {
   e = e[0];

...but then it is still the jQuery Object I passed, which doesn't have the "nodeName" member required later in the code.

This worked before in the older version of the MorphSVG plugin.

Link to comment
Share on other sites

Hello Ninili, and Welcome to the GreenSock Forum!


Do you have a code example so we can see your custom code you see failing? If you can please setup a reduced codepen example so we can see your code in a live editable environment. This way we can see the code your using that is causing the issue in context.


Here is a video tut by GreenSock on how to setup a codepen example so we can better assist you.



Thanks :)

  • Like 1
Link to comment
Share on other sites

I see what you mean, Ninili, and I really appreciate you giving details about exactly where the issue was in the code. It is indeed caused by your element being wrapped in a jQuery object (which should be pretty easy to fix). I'll make the necessary adjustments in the next release, though, so that jQuery objects work too. 

  • Like 3
Link to comment
Share on other sites

  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...