0

Complete Code: Fiddle

I'm trying to learn UMD, I took a day trying to run this Ramjet JS. I don't understand this error that occurs here:

(function (global, factory) {
                typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
                typeof define === 'function' && define.amd ? define(factory) :
                (global.ramjet = factory());
    }(this, function () { 'use strict';
...

It's just at the beginning, it must be a very foolish mistake.

Specifically in the line:

  • (global.ramjet = factory());

Google chrome console says:

Uncaught TypeError: Cannot set property 'ramjet' of undefined

(anonymous function) @ ramjet.umd.js:4

(anonymous function) @ ramjet.umd.js:1

Thank you very much

York Xtrem
  • 58
  • 1
  • 10

1 Answers1

0

The problem was that Babel, compiled bad UMD ramjet.

The solution has been to concatenate the end uncompiled code.

York Xtrem
  • 58
  • 1
  • 10