Jump to content
GreenSock

Jesus Piedrahita

gsap.utils.checkPrefix is not a function

Go to solution Solved by Jesus Piedrahita,

Recommended Posts

Hi,

I need help with this problem

image.thumb.png.532ded54e29bbf75d7632ac6524f7239.png

Note: the gsap object exist, so the import works

 

"gsap": "3.11.2"

Code: I use js modules without any framework, just native js

image.thumb.png.773766c8ab1a3ba73d6ea6451e746d05.png

Link to comment
Share on other sites

Unless you're a very advanced user who doesn't need any CSS animating functionality, you should NOT be importing the "gsap-core" file from the raw src directory. That doesn't include CSSPlugin. Again, it's only intended for very advanced users who have particular needs (no use for CSS animating) - that's almost nobody. :)

 

Typically you don't have to write out the whole path like that anyway - just use the default like: 

import gsap from "gsap";
import ScrollTrigger from "gsap/ScrollTrigger";

If you really want to write out the whole path, then use the index.js file, not gsap-core.js. 

  • Like 1
Link to comment
Share on other sites

  • Solution

Thanks, the problem was not import index.js

 

But I had to import the complete path, in this way works fine.

image.thumb.png.c5f761dc8ad85f3356e868e0c3e91f4b.png

Link to comment
Share on other sites

That's highly unusual. Maybe you've got an odd build system setup that doesn't work with the typical npm/yarn package manager, but I'm glad you got it working. 👍

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