{ "id": "149483", "key": "AC-200", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2015-08-05T08:11:56.000+0000", "created": "2015-07-07T02:03:24.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "rtlechuga", "key": "rtlechuga", "displayName": "Radamantis Torres-Lechuga", "active": false, "timeZone": "Asia/Dubai" }, "updated": "2015-08-19T17:49:16.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [], "description": "I'm using buildin moment.js with locale {{zh-Hant}},\r\nbut I got a uncaught exception and exit the app automatically.\r\n{code}\r\n/alloy/moment/lang/zh-Hant.js, Resource: alloy/moment/lang/zh-Hant_js\r\nUncaught exception: Couldn't find module: alloy/moment/lang/zh-Hant for architecture: i386\r\n{code}\r\n\r\nController:\r\n{code:javascript}\r\nvar moment = require('alloy/moment');\r\nconsole.log(moment.version)\r\n{code}\r\n\r\neven though I use a {{moment + locales.js}} from [official site|http://momentjs.com/] and put the file moment.js on {{lib}}, same problem just happened:\r\n{code:javascript}\r\nvar moment = require('moment');\r\nmoment.locale('en-US'); // exception\r\nmoment.locale('en-us'); // exception\r\nmoment.locale('zh-TW'); // exception\r\nmoment.locale('zh-tw'); // exception\r\nmoment.locale('zh-CN'); // exception\r\nmoment.locale('zh-cn'); // exception\r\nmoment.locale('en'); // working fine\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Using buildin moment.js case uncaught exception", "creator": { "name": "ethancfchen", "key": "ethancfchen", "displayName": "Ethan Chen", "active": true, "timeZone": "Asia/Taipei" }, "subtasks": [], "reporter": { "name": "ethancfchen", "key": "ethancfchen", "displayName": "Ethan Chen", "active": true, "timeZone": "Asia/Taipei" }, "environment": "Appcelerator Studio: 4.0.1.201506021908-02062015191005,\r\nTitanium CLI: 4.0.2,\r\nAlloy: 1.6.0,\r\nTitanium SDK: 4.0.0.GA,\r\nNode.js: 0.10.37,\r\nNPM: 1.4.28", "comment": { "comments": [ { "id": "357125", "author": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\nWe did not reproduce this issue when we use Alloy.builtins.moment we get this following \r\n{code}\r\nvar moment = require('alloy/moment');\r\nconsole.log(moment.version)\r\n{code}\r\n\r\n*Output*\r\n{code}\r\n[INFO] : 2.7.0\r\n{code}\r\n\r\nWhen we use moment + locales.js from [official site|http://momentjs.com/] and put the file on Assets folder and the result, is\r\n\r\n{code}\r\nvar moment = require('moment-with-locales');\r\nconsole.log(moment.locale('en-US')); \r\nconsole.log(moment.locale('en-us')); \r\nconsole.log(moment.locale('zh-TW')); \r\nconsole.log(moment.locale('zh-tw')); \r\nconsole.log(moment.locale('zh-CN')); \r\nconsole.log(moment.locale('zh-cn')); \r\nconsole.log(moment.locale('en')); \r\n{code}\r\n\r\n*Output*\r\n{code}\r\n[INFO] : en\r\n[INFO] : en\r\n[INFO] : zh-tw\r\n[INFO] : zh-tw\r\n[INFO] : zh-cn\r\n[INFO] : zh-cn\r\n[INFO] : en\r\n{code}\r\n\r\nWe did not get any exception.\r\nThanks", "updateAuthor": { "name": "rtlechuga", "key": "rtlechuga", "displayName": "Radamantis Torres-Lechuga", "active": false, "timeZone": "Asia/Dubai" }, "created": "2015-07-07T08:36:13.000+0000", "updated": "2015-07-07T15:44:30.000+0000" }, { "id": "357241", "author": { "name": "ethancfchen", "key": "ethancfchen", "displayName": "Ethan Chen", "active": true, "timeZone": "Asia/Taipei" }, "body": "In the [document|http://docs.appcelerator.com/platform/latest/#!/guide/Alloy_Controllers] it says:\r\n{quote}\r\nSome JavaScript code might not be suitable as controller code, since it does not have an associated view, or you want to separate it from the MVC framework for easier reusability. Create a folder called {{lib}} in the {{app}} directory of your Alloy project. Add your CommonJS modules or JavaScript code using the CommonJS format into the lib folder. These files are copied to the Resources folder, when compiling your Alloy project.\r\n{quote}\r\n\r\nso I put my {{moment.js}} into {{app/lib}}, but still got exception\r\nbq. {code}Couldn'y find module: ./locale/en-US for architecture: i386{code}", "updateAuthor": { "name": "ethancfchen", "key": "ethancfchen", "displayName": "Ethan Chen", "active": true, "timeZone": "Asia/Taipei" }, "created": "2015-07-08T02:32:30.000+0000", "updated": "2015-07-08T02:32:30.000+0000" }, { "id": "357242", "author": { "name": "ethancfchen", "key": "ethancfchen", "displayName": "Ethan Chen", "active": true, "timeZone": "Asia/Taipei" }, "body": "I try putting the {{moment.js}} in {{app/assets}} folder,\r\nsame test code, same exceptions, same crushes.\r\n{code}\r\n[ERROR] : The application has crashed with an uncaught exception 'org.test.kroll'.\r\n[ERROR] : Reason:\r\n[ERROR] : Couldn't find module: ./locale/en-US for architecture: i386\r\n[ERROR] : Stack trace:\r\n[ERROR] : \r\n[ERROR] : 0 CoreFoundation 0x04f7e72a __exceptionPreprocess + 154\r\n[ERROR] : 1 libobjc.A.dylib 0x04b51a97 objc_exception_throw + 44\r\n[ERROR] : 2 test 0x00024550 -[KrollBridge require:path:] + 4496\r\n[ERROR] : 3 test 0x0002d1b6 CommonJSRequireCallback + 230\r\n[ERROR] : 4 test 0x0039fe9a _ZN2TI19APICallbackFunction4callINS_18JSCallbackFunctionEEExPNS_9ExecStateE + 698\r\n[ERROR] : 5 test 0x0037ae86 _ZN2TI14handleHostCallEPNS_9ExecStateENS_7TiValueENS_22CodeSpecializationKindE + 630\r\n[ERROR] : 6 test 0x0037b25c linkFor + 156\r\n[ERROR] : 7 test 0x003758d9 operationLinkCall + 25\r\n[ERROR] : 8 ??? 0x503c9134 0x0 + 1346146612\r\n[ERROR] : \r\n[ERROR] : 2015-07-08 10:33:19.545 test[20774:4690187] *** Terminating app due to uncaught exception 'org.test.kroll', reason: 'Couldn't find module: ./locale/en-US for architecture: i386'\r\n[ERROR] : *** First throw call stack:\r\n[ERROR] : (\r\n[ERROR] : \t0 CoreFoundation 0x04f7e746 __exceptionPreprocess + 182\r\n[ERROR] : \t1 libobjc.A.dylib 0x04b51a97 objc_exception_throw + 44\r\n[ERROR] : \t2 test 0x00024550 -[KrollBridge require:path:] + 4496\r\n[ERROR] : \t3 test 0x0002d1b6 CommonJSRequireCallback + 230\r\n[ERROR] : \t4 test 0x0039fe9a _ZN2TI19APICallbackFunction4callINS_18JSCallbackFunctionEEExPNS_9ExecStateE + 698\r\n[ERROR] : \t5 test 0x0037ae86 _ZN2TI14handleHostCallEPNS_9ExecStateENS_7TiValueENS_22CodeSpecializationKindE + 630\r\n[ERROR] : \t6 test 0x0037b25c linkFor + 156\r\n[ERROR] : \t7 test 0x003758d9 operationLinkCall + 25\r\n[ERROR] : \t8 ??? 0x503c9134 0x0 + 1346146612\r\n[ERROR] : )\r\n[ERROR] : libc++abi.dylib: terminating with uncaught exception of type NSException\r\n{code}", "updateAuthor": { "name": "ethancfchen", "key": "ethancfchen", "displayName": "Ethan Chen", "active": true, "timeZone": "Asia/Taipei" }, "created": "2015-07-08T02:38:08.000+0000", "updated": "2015-07-08T02:38:08.000+0000" }, { "id": "358194", "author": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello [~ethancfchen],\r\n\r\nPlease test with latest Studio 4.1.1 and SDK 4.1.0 and let us know. \r\n\r\nThanks.", "updateAuthor": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2015-07-23T10:25:04.000+0000", "updated": "2015-07-23T10:25:04.000+0000" }, { "id": "360373", "author": { "name": "mcvendrell", "key": "mcvendrell", "displayName": "Manuel Conde Vendrell", "active": true, "timeZone": "Europe/Madrid" }, "body": "Hi. I was able to made it work as @Motiur explained with Ti 4.1.1 (getting moment-with-locales and putting it in assets), but I have one question:\r\n\r\nIs this the new way to use localized moments? In Ti3.5.0GA the translations worked alone, you only need to set the format and moment get the current device language alone.\r\n\r\nWhy this changed in 4.1.1?", "updateAuthor": { "name": "mcvendrell", "key": "mcvendrell", "displayName": "Manuel Conde Vendrell", "active": true, "timeZone": "Europe/Madrid" }, "created": "2015-08-19T17:49:16.000+0000", "updated": "2015-08-19T17:49:16.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }