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');
PR: https://github.com/appcelerator/titanium_mobile/pull/5948
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
Titanium SDK, build 3.4.0.v20140820125714 has the fix :)