Hi,
The rangy-highlighter AMD module is defined with a dependency on rangy-core as far as RequireJS is concerned, but with an additional dependency on rangy-classapplier in the rangy.createModule call.
It is possible that the rangy-classapplier loading is delayed and the whole thing crashes in
if (!requiredModule || !(requiredModule instanceof Module)) {
throw new Error("required module '" + moduleName + "' not found");
}
The fastest way to fix this would be to remove the ClassApplier dependency since it is not used anyway in the initialization code. Like:
rangy.createModule("Highlighter", [""], function(api, module) {
The alternative would be to fix the code in build.js to define the module with the required dependencies which is not trivial (due to naming issues, and choice of automation), or to ditch rangy.createModule in favor of proper AMD/CommonJS code.
I can prepare a PR that implements "the fast way"
Hi,
The
rangy-highlighterAMD module is defined with a dependency onrangy-coreas far as RequireJS is concerned, but with an additional dependency onrangy-classapplierin therangy.createModulecall.It is possible that the
rangy-classapplierloading is delayed and the whole thing crashes inThe fastest way to fix this would be to remove the
ClassApplierdependency since it is not used anyway in the initialization code. Like:The alternative would be to fix the code in
build.jsto define the module with the required dependencies which is not trivial (due to naming issues, and choice of automation), or to ditchrangy.createModulein favor of proper AMD/CommonJS code.I can prepare a PR that implements "the fast way"