Difficulty loading js function from raw Github

That said, using RawGit will only get you halfway in this instance - that file is just a function, with no export syntax. We support require() with AMD/UMD modules, and import() with ES6 modules. You can get around this by doing:

MRG32k3a = require("https://cdn.rawgit.com/nquinlan/better-random-numbers-for-javascript-mirror/master/support/js/MRG32k3a.js").catch(
  () => window.MRG32k3a
)

But ideally the better-random-numbers-for-javascript-mirror project supports any of UMD, AMD, CommonJS, or ES6 modules.

4 Likes