Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17448] iOS: error when commonjs module exports certain types

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2014-08-20T23:29:34.000+0000
Affected Version/sRelease 3.3.0
Fix Version/sRelease 3.4.0
ComponentsiOS
Labelsmodule_module, qe-manualtest
ReporterTony Lukasavage
AssigneePedro Enrique
Created2014-08-02T02:59:03.000+0000
Updated2014-08-20T23:29:35.000+0000

Description

problem

If a commonjs module assigns anything other than the following types to module.exports, the app crashes with no output to the console: * Function * Object * String For example, returning any of the following in module.exports will crash the app: * Number * Boolean * null * undefined * NaN This issue does not seem to appear on Android.

test case

Creating the following simple app will crash the simulator when it is run.

foo.js

module.exports = 123;

// the following cases will also crash

// module.exports = true;
// module.exports = undefined;
// module.exports = null;

app.js

require('foo');

Attachments

FileDateSize
crash_08_20_14.txt2014-08-20T21:37:12.000+000034636

Comments

  1. Pedro Enrique 2014-08-04

    PR: https://github.com/appcelerator/titanium_mobile/pull/5948
  2. Olga Romero 2014-08-20

    Please, see the crash report. Environment tested Mac osx 1-.9.4 Maverics Appcelerator Studio, build: 3.4.0.201408180158 Node.JS Version: v0.10.28 NPM Path: /usr/local/bin/npm NPM Version: 1.4.23 acs@1.0.16 alloy@1.5.0-dev (git://github.com/appcelerator/alloy.git#b2e8f580d023e45c63072df924666e58193a8981) install@0.1.7 npm@1.4.23 sudo@1.0.3 titanium@3.4.0-dev (git://github.com/appcelerator/titanium.git#9079326639c7f610dafee33dd16742de7d92d795) titanium-code-processor@1.1.1 Xcode6 Device: iPhone 5c iOS 7.1
  3. Olga Romero 2014-08-20

    Titanium SDK, build 3.4.0.v20140820125714 has the fix :)

JSON Source