Description
*I consider this a blocker as we will possibly be breaking applications in a minor version, and this also leads to uncertainties as to whether there are anymore issues like this*
When building kitchensink-v2 for iOS with the latest Alloy, the app will error out when launching. With the below error
*Notes*
* The error only occurs when using TiCore, using JSCore the error is not seen. It seems the older TiCore will choke on the code, Android seems to be fine, Windows is currently untested
* The error appears to be caused by the move to babylon/babili
* The code that errors is
var res = { milliseconds: 0, months: 0, months: other.month() - base.month() + 12 * (other.year() - base.year())
};
[ERROR] Script Error {
[ERROR] line = 2058;
[ERROR] message = "Attempted to redefine property 'months'.";
[ERROR] sourceURL = "file:///Users/eharris/Library/Developer/CoreSimulator/Devices/DAE930F3-D384-42DE-B14D-F2EB6DDFE798/data/Containers/Bundle/Application/8EB66036-ABCE-4A04-B5B7-8BF05FDBBECC/KitchenSink.app/alloy/moment.js";
[ERROR] stack = "require@[native code]\nfile:///Users/eharris/Library/Developer/CoreSimulator/Devices/DAE930F3-D384-42DE-B14D-F2EB6DDFE798/data/Containers/Bundle/Application/8EB66036-ABCE-4A04-B5B7-8BF05FDBBECC/KitchenSink.app/log.js:3:21\nglobal code@file:///Users/eharris/Library/Developer/CoreSimulator/Devices/DAE930F3-D384-42DE-B14D-F2EB6DDFE798/data/Containers/Bundle/Application/8EB66036-ABCE-4A04-B5B7-8BF05FDBBECC/KitchenSink.app/log.js:24:70\nrequire@[native code]\nController@file:///Users/eharris/Library/Developer/CoreSimulator/Devices/DAE930F3-D384-42DE-B14D-F2EB6DDFE798/data/Containers/Bundle/Application/8EB66036-ABCE-4A04-B5B7-8BF05FDBBECC/KitchenSink.app/alloy/controllers/controls/index.js:45:19\ncreateController@file:///Users/eharris/Library/Developer/CoreSimulator/Devices/DAE930F3-D384-42DE-B14D-F2EB6DDFE798/data/Containers/Bundle/Application/8EB66036-ABCE-4A04-B5B7-8BF05FDBBECC/KitchenSink.app/alloy.js:306:52\nController@file:///Users/eharris/Library/Developer/CoreSimulator/Devices/DAE930F3-D384-42DE-B14D-F2EB6DDFE798/data/Containers/Bundle/Application/8EB66036-ABCE-4A04-B5B7-8BF05FDBBECC/KitchenSink.app/alloy/controllers/index.js:31:67\ncreateController@file:///Users/eharris/Library/Developer/CoreSimulator/Devices/DAE930F3-D384-42DE-B14D-F2EB6DDFE798/data/Containers/Bundle/Application/8EB66036-ABCE-4A04-B5B7-8BF05FDBBECC/KitchenSink.app/alloy.js:306:52\nglobal code@file:///Users/eharris/Library/Developer/CoreSimulator/Devices/DAE930F3-D384-42DE-B14D-F2EB6DDFE798/data/Containers/Bundle/Application/8EB66036-ABCE-4A04-B5B7-8BF05FDBBECC/KitchenSink.app/app.js:7:23";
[ERROR] }
[ERROR] Script Error Module "alloy/moment.js" failed to leave a valid exports object
[ERROR] Script Error Module "log.js" failed to leave a valid exports object
[DEBUG] Application booted in 891.723990 ms
[ERROR] ErrorController is up. ABORTING showing of modal controller
[ERROR] ErrorController is up. ABORTING showing of modal controller
Steps to reproduce
Install titanium and alloy npm i alloy -g && npm i titanium -g
Build the project using ti build -p ios
Actual
The app will error out
Expected
The app should not error out
Uglify would keep the code as is
https://github.com/appcelerator/alloy/pull/826
[~eharris] Note that this likely means minified builds on the SDK for iOS will have the same issue, as we're using babili to minify there. I think a quick investigation and another ticket likely need to be opened there. I suppose we'll just have to check if we're building for iOS on TiCore *and* minifying and if so, find some way to minify other than babili...
Looks like it's
babel-plugin-transform-inline-consecutive-adds
.[~cwilliams] unsurprisingly you're right TIMOB-24736
Node Version: 6.10.3 NPM Version: 3.10.10 Mac OS: 10.13 Appc CLI: 6.3.0-master.7 Alloy 1.10.5 Appc CLI NPM: 4.2.9 Titanium SDK version: 6.2.2 Verified that kitchensink-v2 runs correctly with the above environment.