Jump to content
Search Community

gsap-core.js.pre-build-optimizer.js:1447 error

merlin test
Moderator Tag

Recommended Posts

Using GSAP V3.0.1

Anyone know why an error like this may occur?
We’re importing eases like this:
import { Power1 } from 'gsap/all'
which is the v2 way.
We’ve tried with power1.in aswell, same error.
The ‘undefined’ comes from Linear which I think makes sense because you can’t ease a linear?

WhatsApp Image 2019-11-21 at 08.39.50.jpeg

Link to comment
Share on other sites

How are you using the eases? You don't have to import the eases unless you are using the object syntax.

 

import { gsap, Power0, Power1 } from "gsap/all"

gsap.to(obj1, { x: 200, ease: Power0.easeNone });
gsap.to(obj2, { x: 200, ease: Power1.easeIn });

 

Using strings, you don't need to import any of the eases.

import { gsap } from "gsap/all"

gsap.to(obj1, { x: 200, ease: "linear" });
gsap.to(obj2, { x: 200, ease: "power1.in" });

// or
gsap.to(obj, { x: 200, ease: "none" });
gsap.to(obj2, { x: 200, ease: "power1.in" });

 

Importing from gsap/all demo

See the Pen e7f67c7a0c37c0b937bc6e8edc124025 by osublake (@osublake) on CodePen

 

 

  • Like 2
Link to comment
Share on other sites

1 minute ago, merlin said:

Not sure if it's an error with the eases in particular. It seems to happen ONLY when running the environment in Docker.

 

I'm not familiar with Docker. Is there anything special about that environment, like can it use es-modules? es-modules is the default that gsap uses, but maybe try using the umd version of gsap.

 

import { gsap, Power0, Power1 } from "gsap/dist/gsap";

 

  • Like 2
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...