Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19545] Unable to use CommonJS modules on real device with SDK 5.0.0.GA

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2015-09-20T09:54:24.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.0.1
ComponentsiOS
LabelsCommonJS, Module, SDK5.0.0
ReporterShuo Liang
AssigneeChris Barber
Created2015-09-18T02:49:06.000+0000
Updated2015-09-22T21:43:51.000+0000

Description

Reproduce

1. Create a new default mobile project. 2. Download a sample CommonJS module superagent from [http://gitt.io/component/superagent] 3. Include the module into project 4. Add following test code into app.js
var request = require('superagent');

request.get('http://www.baidu.com')
.end(function (res) {
  console.log('Textual version of APIs:');
  console.log(res.text);
});
5. Run the app with SDK 4.1.0.GA and 5.0.0.GA on both simulator and real device

Actual Result

For SDK 4.1.0, both simulator and device all work well. For SDK 5.0.0, Only simulator works well, on device, you will get a error like following
[ERROR] Script Error Couldn't find module: superagent for architecture: arm64

Comments

  1. Chris Barber 2015-09-18

    Master PR: https://github.com/appcelerator/titanium_mobile/pull/7204 5_0_X PR: https://github.com/appcelerator/titanium_mobile/pull/7205
  2. Chee Kiat Ng 2015-09-20

    APPROVED. PRs merged.
  3. Vincent Degroote 2015-09-22

    Hi, I noticed the same problem with a deploy type set to test. Hope it will fix this problem as well. thanks
  4. Vincent Degroote 2015-09-22

    I tried with the 5_0_X branch, it works. Thanks.
  5. Lokesh Choudhary 2015-09-22

    Verified the fix. CommonJS module builds fine on a real device. Closing. Environment: Appc Studio : 4.3.0.201509151348 Ti SDK : 5.0.1.v20150922104152 Ti CLI : 5.0.3 Alloy : 1.7.10 MAC Yosemite : 10.10.4 Appc NPM : 4.2.0 Appc CLI : 5.0.2-19 Node: v0.10.37 One plus one - Android 5.1.1

JSON Source