Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

Can't import using webpack 2.2 and gasp with npm

Go to solution Solved by mimamuh,

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



I've tried to import modules from gasp (1.9.1) with npm and webpack 2.2 but I think I made something wrong as I don't get the libs??


For example, when I import 'gsap/TweenLite' I get an Object back, but it has no 'to' property:

import TweenLite from 'gsap/TweenLite';
console.log(TweenLite); // => Object {}
console.log(TweenLite.to); // => undefined

Shouldn't it be both functions?


The same happens when I try to import TweenMax like:

import TweenMax from 'gsap';
console.log(TweenMax); // => Object {}
console.log(TweenMax.to); // => undefined

When I try to import TweenLite directly I simply get nothing:

import { TweenLite } from 'gsap';
console.log(TweenLite); // => undefined 

I'm not sure if it is a issue of mine, as I use greensock the first time.


Does anybody have an idea?



Link to comment
Share on other sites

  • Solution

Okay, I've found my issue:


I accidentally loaded the lib in the head already which caused the trouble:

<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.19.1/TweenMax.min.js"></script>
  • Like 1
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.