TweenMax gsap error Android and Simulator

Hi everyone. The application does not start in the simulator and android.
Version cocos creator 2.0.8 and 2.0.9-rc2
Version gsap 1.20.1
error immediately when starting the application, when importing gsap.

I use gsap

import { TweenLite, Bounce, Circ } from “gsap”;

Error:

Simulator: E/jswrapper (271): ERROR: Uncaught TypeError: container.appendChild is not a function, location: __node_modules/gsap/umd/TweenMax.js:0:0

STACK:

[0]_createSVG@__node_modules/gsap/umd/TweenMax.js:3781
[1]anonymous@__node_modules/gsap/umd/TweenMax.js:3790
[2]anonymous@__node_modules/gsap/umd/TweenMax.js:3799
[3]Definition.check@__node_modules/gsap/umd/TweenMax.js:6171
[4]Definition@__node_modules/gsap/umd/TweenMax.js:6194
[5]window._gsDefine@__node_modules/gsap/umd/TweenMax.js:6199
[6]anonymous@__node_modules/gsap/umd/TweenMax.js:2573
[7]anonymous@__node_modules/gsap/umd/TweenMax.js:8004
[8]anonymous@__node_modules/gsap/umd/TweenMax.js:8015
[9]__define@__node_modules/gsap/umd/TweenMax.js:8016
[10]anonymous@__node_modules/gsap/umd/TweenMax.js:8024
[11]cc.require@src/modular.js:64

Hey there,

We just had a similar issue, and I worked a bit of it out with the gsap team here: https://greensock.com/forums/topic/19943-possible-to-remove-plugins-from-gsap-builds

The solution is to manually remove the CSSPlugin from the TweenMax file, the plugin is roughly 2000 lines. Fortunately both it and the plugin following have big block comments to make it easy to see where one starts and the other ends.

Unfortunately this makes it difficult if you’re working with gsap from an npm module. But you’re also able to just include TweenMax as part of your assets.

Hope this helps!

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.