Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2979] Android: CommonJS modules are not cached in latest CI builds

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2012-06-21T11:13:54.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterIvan Skugor
AssigneeMauro Parra-Miranda
Created2012-06-18T06:25:22.000+0000
Updated2016-03-08T07:47:59.000+0000

Description

The problem

Latest CI builds do not cache CommonJS modules (or at least it seems they don't in some cases). That cause all kind of strange issue (one will be demonstrated in test case). This commit causes this behavior: https://github.com/appcelerator/titanium_mobile/commit/70a9f7984281b8e9ab9c8d73ec3afadc79778b8b (before that commit, everything works fine)

Test case

// app.js
function runTest() {
    var test1 = require('test/test1');
    Ti.API.debug(test1.blabla.test);
}

runTest();
runTest();


// test/test1.js
Ti.API.info('Test 1 require');

var test2 = require('test/test2');

var myModule = {
    blabla: {
        test: test2.test + ' Yes, no?'
    }
};

module.exports = myModule;



// test/test2.js
var test = 'Success!';

var objectToExport = {
   test: test
};

module.exports = objectToExport;
Output: 06-18 13:21:42.790: I/TiAPI(1925): Test 1 require 06-18 13:21:42.800: D/TiAPI(1925): Success! Yes, no? 06-18 13:21:42.800: I/TiAPI(1925): Test 1 require 06-18 13:21:42.800: D/TiAPI(1925): undefined Yes, no?

Expected output

There should be only one "Test 1 require" console line and forth line should be identical to second one.

Comments

  1. Ivan Skugor 2012-06-18

    Btw, this works fine on iOS.
  2. Ivan Skugor 2012-06-21

  3. Nikhil Sharma 2012-06-21

    This ticket is duplicate of TIMOB-9662.
  4. Mauro Parra-Miranda 2013-11-24

    DUP issue.

JSON Source