Hi,
Loving what you guys are doing here and I'm a massive fan of GSAP
I am using it in a fairly large project at the moment and all of a sudden I'm getting the below errors. My NPM package imports GSAP via ES imports and works great in my Storybook environment.
import 'gsap'
import ScrollToPlugin from 'gsap/umd/ScrollToPlugin'
I published a new version of this package recently and all of a sudden, the environment which imports my package (which is a SSR app with Node+React) is complaining about document being undefined.
TypeError: Cannot read property 'document' of undefined
The error coming from the minified output of what seems to be the CSSPlugin.js file.
/*!
* VERSION: 1.20.5
* DATE: 2018-05-21
* UPDATES AND DOCS AT: http://greensock.com
*
* @license Copyright (c) 2008-2018, GreenSock. All rights reserved.
* This work is subject to the terms at http://greensock.com/standard-license or for
* Club GreenSock members, the software agreement that was issued with your membership.
*
* @author: Jack Doyle, jack@greensock.com
*/s.d(c,"d",function(){return n}),s.d(c,"e",function(){return r}),s.d(c,"c",function(){return i}),s.d(c,"a",function(){return a}),s.d(c,"b",function(){return u});var n="undefined"!=typeof window?window:e.exports&&void 0!==t?t:void 0,r=function(f){var p={},r=f.document,d=f.GreenSockGlobals=f.GreenSockGlobals||f;if(d.TweenLite)return d.TweenLite;function h(e){var t,n=e.split("."),r=d;for(t=0;t<n.length;t++)r[n[t]]=r=r[n[t]]||{};return r}function c(e){var t,n=[],r=e.length;for(t=0;t!==r;n.push(e[t++]));return n}function m(){}function y(u,c,s,l){this.sc=E[u]?E[u].sc:[],(E[u]=this).gsClass=null,this.func=s;var f=[];
...
*snip*
...
The error comes from the first reference to `document` in that example above (f.document)
Oddly this has been working until I recently upgraded to Webpack 4 & Babel 7 so I suspect that is an avenue to explore but I am just a little lost as to why that impact this.
Using latest v2 of GSAP on NPM. I have tried manually forcing `global.document = {}` in my node environment as a temporary measure but that doesn't help.
Thanks in advance