lukePeavey / SplitType

Javascript utility that splits text into lines, words, characters for animation
https://lukepeavey.github.io/SplitType/
545 stars 39 forks source link

ReferenceError: Element is not defined #45

Closed jjcrl closed 2 years ago

jjcrl commented 2 years ago

Issues when importing SplitType within next.js. Errors with ''/node_modules/split-type/umd/index.js''

lukePeavey commented 2 years ago

I'll take a look at this...

Try importing it from ‘spit-type/dist’ and see if that works.

jjcrl commented 2 years ago

Thank you ! Still showing errors, Server Error SyntaxError: Unexpected token 'export' I've tried dynamic imports but had no luck with that either .

lukePeavey commented 2 years ago

Ok thanks.

I'll work on this later today. As a temp solution you could try downgrading to v0.2.5. This bug was probably introduced in the V0.3 update. Prior to that the library was working with next is, as far as I know

lukePeavey commented 2 years ago

@jjcrl I found the problem. Will release a patch version later today that should fix this.

jjcrl commented 2 years ago

Amazing !! Thank you

lukePeavey commented 2 years ago

@jjcrl Should be fixed in v0.3.2.

Let me know if this worked for you.

jjcrl commented 2 years ago

updated to v0.3.2 and all working as expected. Thank you 🙏