ajaxorg/cloud9 — Issue #463: Error on debug mode
Author: tojocky
Created: 2011-11-18 15:20:41+00:00
State: open

Hello,

The application does not work in debug mode because on page load the JS require(load) file /static/support/apf/apf.js but this file does not have method apf.addEventListener. The require method are located to "core/class.js".

Error message:
Uncaught Error: Error evaluating module "undefined" at location "":
TypeError: Object [Ajax.org Platform (apf)] has no method 'addEventListener'
fileName:undefined
lineNumber: undefined
http://requirejs.org/docs/errors.html#defineerror

It is a good idea to require/load modules on page load. Because can we can have modules which the page does not need.

As a solution can be:
All methods which will be loaded should call require method and after the module loaded need to call the waiting stack callbacks.