CenterForOpenScience / osf.io

Facilitating Open Science
https://osf.io
Apache License 2.0
667 stars 328 forks source link

ERROR in ./~/gsap/src/minified/easing/EasePack.min.js #4855

Closed TomBaxter closed 2 years ago

TomBaxter commented 8 years ago

I was updating my osf.io install for my development Environment today and ran into this issue when running "invoke setup" This is on Ubuntu. I dug into the Docker repo to make sure I was installing NPM and node.js in the same way and same versions as the production server.

ERROR in ./~/gsap/src/minified/easing/EasePack.min.js Module not found: Error: Cannot resolve 'file' or 'directory' ../TweenLite.js in /home/tkb/work/venv/cos/osf/osf.io/node_modules/gsap/src/minified/easing @ ./~/gsap/src/minified/easing/EasePack.min.js 12:5032-5058

I manually updated node_modules/gsap/src/minified/easing/EasePack.min.js , which fixed the issue.

Changed the last line from ...

TweenLite.js

"function"==typeof define&&define.amd?define(["TweenLite"],a):"undefined"!=typeof module&&module.exports&&(require("../TweenLite.js"),module.exports=a())}();

to...

TweenLite.min.js

"function"==typeof define&&define.amd?define(["TweenLite"],a):"undefined"!=typeof module&&module.exports&&(require("../TweenLite.min.js"),module.exports=a())}();

sloria commented 8 years ago

@TomBaxter what version of gsap do you have installed?

TomBaxter commented 8 years ago

@sloria 1.18.2 the latest. I verified the code is in their github repo and opened as issue with them.

greensock/GreenSock-JS/issues/133

sloria commented 8 years ago

Looks like the error was introduced by 1.18.2. I'll go ahead and pin to 1.18.0 for now until this is resolved. It's hard to tell if the bug is on our end or theirs; we are aliasing TweenLite and EasePack to the minified files here: https://github.com/CenterForOpenScience/osf.io/blob/2924d12c472450822fc190da894199265a8a1698/webpack.common.config.js#L133-L135 , which isn't best practice (better to use unminified files for development and let webpack do the minifying).

TomBaxter commented 8 years ago

@sloria

Got a quick response from the GreenSock developer. Sounds like we will need to change things on our end. His comments agree with yours on "best practice."

Sorry, we were specifically asked to use the unminified code so that it's easier to troubleshoot. Plus most build systems have a separate step that minifies the code anyway, typically merging it all into 1 file.

and ...

No no, you'd just use the stuff inside /uncompressed/. That way, all the paths are correct. It sounds like the confusion in your case is that you're plugging into the /minified/ version(s). The proper way to do it is use the uncompressed stuff during production and just have a minification task as part of your build process (that's very common). Easier debugging and faster loading for the end user.