Menu icon Foundation
Module AMD/CommonJS/Browser Global not working

Example scrollmagic module, but it happens with others too.

 

How can we reproduce this bug?

1. Git clone https://github.com/zurb/foundation-zurb-template projectname

2. Install:

   npm install gsap --save-dev

   bower install scrollmagic --save-dev

3. Add text line config.yml:

    - "node_modules/gsap/src/uncompressed/TweenMax.js"

    - "bower_components/scrollmagic/scrollmagic/uncompressed/ScrollMagic.js"

    - "bower_components/scrollmagic/scrollmagic/uncompressed/plugins/animation.gsap.js"

    - "bower_components/scrollmagic/scrollmagic/uncompressed/plugins/debug.addIndicators.js"

    - "bower_components/scrollmagic/scrollmagic/uncompressed/plugins/jquery.ScrollMagic.js"

 

In console Google Chrome:

`Uncaught TypeError: Cannot set property 'ScrollMagic' of undefined`

 

amdcommonjsmoduletemplate zurb

Example scrollmagic module, but it happens with others too.

 

How can we reproduce this bug?

1. Git clone https://github.com/zurb/foundation-zurb-template projectname

2. Install:

   npm install gsap --save-dev

   bower install scrollmagic --save-dev

3. Add text line config.yml:

    - "node_modules/gsap/src/uncompressed/TweenMax.js"

    - "bower_components/scrollmagic/scrollmagic/uncompressed/ScrollMagic.js"

    - "bower_components/scrollmagic/scrollmagic/uncompressed/plugins/animation.gsap.js"

    - "bower_components/scrollmagic/scrollmagic/uncompressed/plugins/debug.addIndicators.js"

    - "bower_components/scrollmagic/scrollmagic/uncompressed/plugins/jquery.ScrollMagic.js"

 

In console Google Chrome:

`Uncaught TypeError: Cannot set property 'ScrollMagic' of undefined`

 

Lincoln Alves almost 3 years ago

Hi, york!

I'm facing the same issue here.

 

Uncaught TypeError: Cannot set property 'ScrollMagic' of undefined

    at ScrollMagic.js:25

    at ScrollMagic.js:16

 

I didn't find anything yet but Im going through this now: http://stackoverflow.com/questions/34973442/how-to-stop-babel-from-transpiling-this-to-undefined?answertab=active#tab-top

york almost 3 years ago

Hi Lincon!

 

Here my pull request with solution ;)

 

https://github.com/zurb/foundation-zurb-template/pull/43/