Jump to content
GreenSock

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

gsap v2 unable bundle in wepack - uglify errors

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

Hi,

 

I'm getting this error when trying to bundle in webpack. I have read through many posts on these forums pertaining to npm usage and feel I'm up to speed on correct usage. What's interesting is webpack-dev-server is working fine but the issue only crops up with uglify when bundling. 

 

Quote

ERROR in js/main.js from UglifyJs
Name expected [js/main.js:4822,6]

 

Line 4822 = 

const {Ease, Linear, Power0, Power1, Power2, Power3, Power4, TweenPlugin} = _gsScope;

 

I'm running webpack 2.2.1 and gsap 2.0.1. Any help is greatly appreciated.

 

 - MD

Link to comment
Share on other sites

I think you might be using an outdated version - that was one line in 2.0.0 that caused issues with some minifiers (like Uglify) that didn't understand ES6 destructuring, so we pushed 2.0.1 which fixed that. Maybe you've got something old cached? I'm pretty sure if you update to 2.0.1, the problem will go away. 

  • Like 2
Link to comment
Share on other sites

Thanks Jack.

 

I cleared cached, deleted the `node_modules` folder and reinstalled and am still having the same issue. I'm wondering if the culprit is a collection of custom npm packages that are running gsap 1.19 as a peer dependency. Hmmm...

Link to comment
Share on other sites

3 hours ago, Mike D said:

I cleared cached, deleted the `node_modules` folder and reinstalled and am still having the same issue. I'm wondering if the culprit is a collection of custom npm packages that are running gsap 1.19 as a peer dependency. Hmmm...

 

Yeah, it sounds like there must be something else going on. Feel free to search the 2.0.1 codebase and you should find that there's no such line like the one you quoted. And it wouldn't be in 1.19 either. It sure sounds like there's a 2.0.0 somewhere, or perhaps even 1.20.5 or 1.20.6? 

Link to comment
Share on other sites

  • 5 months later...
On 6/18/2018 at 8:29 PM, Mike D said:

What's interesting is webpack-dev-server is working fine but the issue only crops up with uglify when bundling.


...

 

For what it's worth on this months old thread: when running webpack-dev-server uglifyjs will never fire. At least not in development mode. Minifying only happens on a production build.

 

The problem you were having might be the same I had months ago too on Webpack with GSAP. In the end I just used Babel on the node_modules gsap folder too so it got transpiled to ES5 when loading modules in the es6 code from 'gsap/all'. Since then no more problems like this. So if you still have this problem it could help you too.

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