Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19914] Creation of Packaged JavaScript and Hybrid Modules: it doesn't work properly

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionDuplicate
Resolution Date2020-01-07T18:35:53.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsmodule, studio, titanium
ReporterAndrea Vitale
AssigneeUnknown
Created2015-06-21T13:34:41.000+0000
Updated2020-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.

Comments

  1. Alan Hutton 2020-01-07

    Closing as duplicate of TIMOB-23490

JSON Source