{ "id": "91797", "key": "TIMOB-9123", "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": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2012-05-14T09:49:28.000+0000", "created": "2012-05-14T06:32:31.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "mobileweb", "parity" ], "versions": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" }, { "id": "13272", "description": "Release 2.0.1", "name": "Release 2.0.1", "archived": true, "released": true, "releaseDate": "2012-04-16" } ], "issuelinks": [ { "id": "17251", "type": { "id": "10000", "name": "Blocks", "inward": "is blocked by", "outward": "blocks" }, "outwardIssue": { "id": "91798", "key": "ALOY-7", "fields": { "summary": "Current require() scheme fails on Mobileweb", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updated": "2014-01-28T23:57:34.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": "11500", "name": "MobileWeb", "description": "Mobile Web (HTML) Platform" } ], "description": "h2. Problem\r\n\r\nWhenever an absolute path is used for a require in mobileweb, I get the red screen of death indicating that the module cannot be found.\r\n\r\nh2. Expected Behavior\r\n\r\nLike with Android and iOS, when an absolute path is given for a {{require()}}, the call should be made relative to the {{Resources}} directory. \r\n\r\nh2. Test Case\r\n\r\nThe following test case work fine in Android and iOS, gives a red screen in mobileweb\r\n\r\nh4. app.js\r\n{code:javascript}\r\nrequire('/test/test');\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#fff',\r\n fullscreen: false,\r\n exitOnClose: true\r\n});\r\nwin.open();\r\n{code} \r\n\r\nh4. test/test.js\r\n{code:javascript}\r\nmodule.exports = {};\r\n{code}", "attachment": [], "flagged": false, "summary": "Mobileweb: require() with absolute path fails", "creator": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Mac OSX 10.7.3\r\nChrome 18.0.1025.168 & Firefox 11.0\r\nTiStudio 2.0.2\r\nTi SDK: 2.0.1GA2 and 2.1.0 master", "comment": { "comments": [ { "id": "194670", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "require() does not support absolute paths and it never will. No implementation does except Ti, which was an oversight.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2012-05-14T09:49:28.000+0000", "updated": "2012-05-14T09:49:28.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }