So when importing an external module like so
import GameObjects = module("GameObjects")
the outputed JS has this at the top of the file:
var GameObjects = require("./GameObjects")
but gives this error when run in chrome:> Uncaught ReferenceError: require is not defined
how do I get by this error?
External modules require a module loader to be present. If you run this in your browser you have to take care of including a module loader yourself. Please take a look at require.js, it has all the documentation that's needed to get the module loader running.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With