{ "id": "99394", "key": "TIMOB-10491", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "14064", "description": "Sprint 2012-17 Core", "name": "Sprint 2012-17 Core", "archived": true, "released": true, "releaseDate": "2012-08-27" }, { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-12-21T05:25:09.000+0000", "created": "2012-08-17T19:00:27.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "core", "module_require", "qe-review", "qe-testadded", "regression" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [ { "id": "20075", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "99550", "key": "ALOY-198", "fields": { "summary": "Alloy does not work with the latest 2.2.0 master of titanium_mobile for iOS", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-12-21T05:25:09.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": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "When running Alloy on iOS 2.2.0 master the alloy.js commonjs module can not be found. It is required in as require('alloy') other modules are loading okay. The path to alloy.js is Resources/alloy.js there is also a folder alloy.", "attachment": [], "flagged": false, "summary": "iOS: Changes to how iOS does require in 2.2 have broken require ", "creator": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "215479", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Here's a minimal test case that is *NOT* alloy specific. The name alloy is used for the modules and it uses a similar structure, but this is pure Titanium code. These following three files do not require Alloy to show the following error:\r\n\r\n{quote}\r\n[ERROR] Script Error = Couldn't find module: alloy\r\n2012-08-21 19:05:31.125 testRequireBug[28934:1a70b] *** Terminating app due to uncaught exception of class '__NSCFString'\r\nterminate called throwing an exception\r\n[INFO] Application has exited from Simulator\r\n{quote}\r\n\r\nh2. Test Case\r\n\r\nh4. app.js\r\n\r\n{code:javascript}\r\nrequire('alloy').getController('index');\r\n{code}\r\n\r\nh4. alloy.js\r\n\r\n{code:javascript}\r\nexports.getController = function(name, args) {\r\n return new (require(\"alloy/controllers/\" + name))(args); \r\n}\r\n{code}\r\n\r\nh4. alloy/controllers/index.js\r\n\r\n{code:javascript}\r\nvar Alloy = require('alloy'); // commenting this line avoids the error\r\nmodule.exports = function Controller() {};\r\n{code}", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-21T16:08:34.000+0000", "updated": "2012-08-21T16:08:34.000+0000" }, { "id": "215480", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It is also worth nothing that Alloy works fine with the lastest TiSDK 2.2.0 with Android and Mobileweb. Alloy actually worked with iOS on 2.2.0 up until about a week or two ago.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-21T16:10:24.000+0000", "updated": "2012-08-21T16:10:24.000+0000" }, { "id": "215494", "author": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Looking at the code with Blain it appears that perhaps the commonjs spec may not have been followed as intended in the latest iOS code. Please see #4, #5 below as it talks about top level modules:\r\n\r\nCommonJS 1.1 Spec - Module Identifiers\r\n1) A module identifier is a String of \"terms\" delimited by forward slashes.\r\n2) A term must be a camelCase identifier, \".\", or \"..\".\r\n3) Module identifiers may not have file-name extensions like \".js\".\r\n4) Module identifiers may be \"relative\" or \"top-level\". A module identifier is \"relative\" if the first term is \".\" or \"..\".\r\n5) Top-level identifiers are resolved off the conceptual module name space root.\r\n6) Relative identifiers are resolved relative to the identifier of the module in which \"require\" is written and called.", "updateAuthor": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-21T16:54:23.000+0000", "updated": "2012-08-21T16:54:23.000+0000" }, { "id": "215689", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR pending https://github.com/appcelerator/titanium_mobile/pull/2806", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-22T14:54:18.000+0000", "updated": "2012-08-22T14:54:18.000+0000" }, { "id": "215928", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Pull merged.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-23T16:27:44.000+0000", "updated": "2012-08-23T16:27:44.000+0000" }, { "id": "216398", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "No error shown when tested by creating a titanium app and module named alloy\r\nVerified on:\r\nTitanium Studio: 2.1.2.201208201549\r\nTitanium SDK: 2.2.0.v20120827143312\r\niPhone Simulator (v5.1)", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-28T03:09:49.000+0000", "updated": "2012-08-28T03:09:49.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }