Hi there, i'm trying to initialize gsap for testing a basic sample on Magento 2.4.1 theme.
This is the basic example i'm testing:
https://codemyui.com/airplane-on-runway-to-flying-transition-toggle-switch/
In my cms page i loaded the html
this is my requirejs-config
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
var config = {
map: {
'*':{
gsap_js: 'js/gsap.custom',
}
},
paths: {
'gsap': 'js/gsap.min',
},
shim: {
'gsap': {
exports: 'gsap'
},
'gsap_js':{
deps: ['jquery','gsap']
}
}
};
And here it is the js code gsap_js
require([
"jquery",
"gsap",
"domReady!"
], function($,gsap){
//ALL THE JS CODE OF THE BASIC EXAMPLE
// FOR EXAMPLE in some line has been called this method:
// gsap.timeline
});
The problem is that when i go to the page i receive this error:
Uncaught TypeError: gsap.timeline is not a function
If i check inside network tabs, the gsap library has been loaded and it should be all okey but i don't know why, gsap.timeline is not identified as a function.
Can someone help me on this?