Jump to content
GreenSock

martis

Error with SplitText

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

Hi guys,

 

Been working on transitioning some things over to Vue (nuxt) and am getting this error with SplitText... seems to be something with _slice and _split functions?

Pretty sure what I am trying to split is not undefined :)

 

client.js:531 [nuxt] Error while initializing app TypeError: Cannot read property 'length' of undefined
    at _slice (SplitText.js:142)
    at _split (SplitText.js:497)
    at webpackJsonp../assets/js/libs/greensock/SplitText.js.pkg.SplitText._globals.SplitText.webpackJsonp../assets/js/libs/greensock/SplitText.js.p.split (SplitText.js:545)
    at new webpackJsonp../assets/js/libs/greensock/SplitText.js.pkg.SplitText._globals.SplitText (SplitText.js:121)

 

Link to comment
Share on other sites

Hm, tough to say for sure without seeing your project but it sounds like the element you're splitting is literally returning null for its "childNodes" property. My understanding is that an element's childNodes should always return a NodeList. Seems like that's not happening in your case for some reason. Are you positive that you're passing in a valid DOM element to SplitText as the target? 

  • Like 2
Link to comment
Share on other sites

This was the case and I found the fix, sorry for the alarm :)

  • Like 1
Link to comment
Share on other sites

No problem at all. Glad you figured it out. Good luck with the project.

Link to comment
Share on other sites

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.
×