[TIMOB-19914] Creation of Packaged JavaScript and Hybrid Modules: it doesn't work properly
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2020-01-07T18:35:53.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | module, studio, titanium |
Reporter | Andrea Vitale |
Assignee | Unknown |
Created | 2015-06-21T13:34:41.000+0000 |
Updated | 2020-01-07T18:35:53.000+0000 |
Description
When I create a CommonJS Module, any exported method is accessible.
In detail for the module I've:
Created a new Mobile Module Project, from Appcelerator Studio, with id (for example) it.module.test
Inside _assets_ folder, I've created a js file called _it.module.test.js_
Into _it.module.test.js_ I have:
exports = {
something: "hi"
}
Now I package this module directly from Appcelerator Studio and install this module inside a Test Application.
Into this application I do:
var module = require("it.module.test");
Ti.API.info(module.something);
And the result is *null*.
It seems that the problem is that the native module classes have being called instead of the CommonJS ones as per the docs.
Closing as duplicate of TIMOB-23490