Hi, for a special http REST API I try to build a module. This is my test code:
var Module = function() { return this; }; Module.prototype = { getProperty : function() { } }; module.exports = Module;This JS file is living in iphone/assets folder and is named like the appid (de.appwerft.testjsmodule.js). Now I can compile with python build.py, unzip and copy into folder. In tiapp.xml is:
<module platform="iphone">de.appwerft.testjsmodule</module>After compiling:
var myObj = new (require('de.appwerft.testjsmodule'))(); myObj.getProperty();After starting on console log:
[INFO] : [object DeAppwerftTestjsmoduleModule] loaded [ERROR] : Script Error { [ERROR] : backtrace = "#0 () at :0"; [ERROR] : line = 9; [ERROR] : message = "'' is not a constructor (evaluating 'new (require('de.appwerft.testjsmodule'))()')"; [ERROR] : name = TypeError; [ERROR] : sourceId = 315865504; [ERROR] : sourceURL = "file:///Us____/app.js"; [ERROR] : }Any ideas whats going wrong? If I embed my mini module in classical form (referencing to js file in Resources folder) it works as aspected.