Jump to content
Search Community

GSAP with create-react-app webpack

Thinkingbox Developer test
Moderator Tag

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 everyone,

 

I've recently been on the process of migrating one of our existing projects to using create-react-app (CRA), and have been running into this issue (attached image).

 

When viewing the compiled version...

> 2546 | return Promise.all([gsap_promise__WEBPACK_IMPORTED_MODULE_3___default.a.fromTo(this.$outer, ANIM_TIME, {
  2547 |   y: '110%'                                                               ^
  2548 | }, {
  2549 |   y: "0%",

 

We're using the GSAP Promise wrapper gsap-promise, which was used on both projects. I've tried reverting the GSAP package version to the same one and the same issue still occurs, which leads me to think that this might be a Webpack configuration issue. I've ejected the CRA project, but haven't been able to figure out which webpack configuration I may need to change.

 

Screen Shot 2019-06-28 at 10.40.58 AM.png

Link to comment
Share on other sites

Welcome to the forums, @Thinkingbox Developer. Sorry, but it's really tough to troubleshoot blind and this doesn't really sound like a GSAP issue. I'm not a Webpack guy, nor do we support the 3rd party gsap-promise library, so I'm not quite sure how to help here. Oh, and by the way, I'd strongly recommend using the yPercent:110 instead of y:"110%" format to be explicit about percentage-based values. That's totally unrelated to the issue you posted about, of course. 

 

Are you using the latest version of GSAP? And did you install it from NPM? 

  • Like 3
Link to comment
Share on other sites

1 minute ago, GreenSock said:

Welcome to the forums, @Thinkingbox Developer. Sorry, but it's really tough to troubleshoot blind and this doesn't really sound like a GSAP issue. I'm not a Webpack guy, nor do we support the 3rd party gsap-promise library, so I'm not quite sure how to help here. Oh, and by the way, I'd strongly recommend using the yPercent:110 instead of y:"110%" format to be explicit about percentage-based values. That's totally unrelated to the issue you posted about, of course. 

 

Are you using the latest version of GSAP? And did you install it from NPM? 

 

Thanks for your response. Our GSAP is indeed the latest version from NPM. Doing further investigation, I feel like this issue here seems to illustrate the problem I'm running into:

 

https://github.com/greensock/GreenSock-JS/issues/261

 

Looking into the 3rd party library, it doesn't seem like they're getting the full TweenMax object but rather, an empty object. 

Link to comment
Share on other sites

On 6/28/2019 at 4:54 PM, Thinkingbox Developer said:

Looking into the 3rd party library, it doesn't seem like they're getting the full TweenMax object but rather, an empty object. 

 

For that to work, you might have to import the umd version of TweenMax. But that's just a guess.

 

Is there any particular need for that library? I would just use regular promises and async/await.

 

 

 

  • Like 1
Link to comment
Share on other sites

21 hours ago, OSUblake said:

 

 For that to work, you might have to import the umd version of TweenMax. But that's just a guess.

 

 Is there any particular need for that library? I would just use regular promises and async/await.

 



 

 

 

Thanks for your response @OSUblake

 

We initially started using this library for the promise functionality, and since it's used so many times it'll be hard to just pull out to swap to just regular promises. On top of that, it seems like the importing issues are also happening for other libraries too so I feel like I'd have to get to the bottom of this webpack importing issue.

Link to comment
Share on other sites

26 minutes ago, Thinkingbox Developer said:

On top of that, it seems like the importing issues are also happening for other libraries too so I feel like I'd have to get to the bottom of this webpack importing issue.

 

The only thing I can tell you is to try using version 3 of webpack. Later versions handle require and import statements differently.

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