Jump to content
Search Community

Import GSAP into Laravel project

Daniel Lydianov test
Moderator Tag

Recommended Posts

Hello everyone. I have a problem importing gsap files into my laravel project. I have external javascript in which im trying to import gsap files. Those files stays in node_modules folder. This is the console error:"ReferenceError: TimelineMax is not defined".  It works with cdn, but i have to do it the other way. Here is visual example of my blade and javascript.

See the Pen vYGqGZj by petya-yaneva (@petya-yaneva) on CodePen

Link to comment
Share on other sites

Hey Daniel and welcome to the GreenSock forums. Thanks for supporting GreenSock with a Club GreenSock memberhip!

 

First off, we don't recommend using anything that has Lite or Max in it. That's the old GSAP syntax. We highly recommend using the GSAP 3 syntax that's better and allows you to use new functionality! See this post for more info:

 

In regards to your question, it's hard to say because I'm not familiar with Laravel. It looks like you are loading GSAP as a module. In that case you should use the module version of GSAP, not the UMD/minified version. 

 

There's also the possibility that you are loading GSAP correctly but you are just not importing TimelineMax. You can fix that simply by upgrading to the GSAP 3 syntax. Otherwise you'll need to import the TimelineMax object as well. 

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.
×
×
  • Create New...