{ "id": "106697", "key": "TIMOB-12115", "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": "14164", "description": "Release 3.0.2", "name": "Release 3.0.2", "archived": true, "released": true, "releaseDate": "2013-02-19" } ], "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": "2013-04-08T11:30:58.000+0000", "created": "2012-12-18T16:14:45.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "parity" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [], "assignee": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-21T21:54:44.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": "h2. problem\r\n\r\nIf I define a commonjs module named *utils.js* or *Utils.js* in my iOS project, I get a runtime error when trying to access it. The error looks like the attached screenshot when used with the test case below. This issue does *not* occur on Android or Mobileweb. This error also does not occur if I move utils.js into a folder. I assume that iOS is overwriting utils.js within an internally used module of it own, or something to that effect.\r\n\r\nh2. expected behavior\r\n\r\nI should be able to define and use a commonjs module named utils.js or Utils.js in my iOS project.\r\n\r\nh2. test case\r\n\r\nh4. utils.js\r\n\r\n{code:javascript}\r\nexports.sayHi = function() {\r\n alert('hi');\r\n}\r\n{code}\r\n\r\nh4. app.js \r\n\r\n{code:javascript}\r\nrequire('utils').sayHi(); \r\n{code}", "attachment": [ { "id": "34241", "filename": "Screen Shot 2012-12-18 at 11.14.30 AM.png", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-18T16:14:45.000+0000", "size": 43041, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: utils.js commonjs module will not work on iOS", "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": "TiSDK 3.0.0.GA\r\niOS 6", "comment": { "comments": [ { "id": "232124", "author": { "name": "jh", "key": "jh", "displayName": "JH", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The titanium submodule utils is imported. The same goes for all .js files named as titanium submodules.\r\n\r\nMore info here:\r\nhttp://developer.appcelerator.com/question/145896/ti-30-requireui-returns-the-tiui-module-instead-of-uijs\r\n", "updateAuthor": { "name": "jh", "key": "jh", "displayName": "JH", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-20T09:06:54.000+0000", "updated": "2012-12-20T09:07:16.000+0000" }, { "id": "235339", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Yet another case: http://developer.appcelerator.com/question/147253/commonjs-module-not-working-in-ios-simulator", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-22T16:53:16.000+0000", "updated": "2013-01-22T16:53:16.000+0000" }, { "id": "246392", "author": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Issue does not reproduces \r\n\r\nTested with\r\n\r\nTitanium Studio, build: 3.0.1.201212181159\r\nTitanium SDK version: 3.1.0 \r\nTitanium SDK version: 3.0.2 \r\niOS iPhone Simulator: iOS SDK version: 6.0", "updateAuthor": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-08T11:30:58.000+0000", "updated": "2013-04-08T11:30:58.000+0000" }, { "id": "246398", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Is there any info on where this was actually resolved? A commit in 3.0.2 or something? \r\n\r\nI just confirmed that it is now working properly in 3.1.0 for me as well.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-08T12:06:29.000+0000", "updated": "2013-04-08T12:06:54.000+0000" }, { "id": "258694", "author": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Issue does not reproduces\n\nTested with\n\niOS SDK: 5.1\niOS iPhone Simulator: 5.1\nMac OS X Version 10.7.5\nTitanium SDK version 3.1.1.v20130606121419\nTitanium Studio, build: 3.0.1.201212181159\n", "updateAuthor": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-06-20T07:43:28.000+0000", "updated": "2013-06-20T07:43:28.000+0000" }, { "id": "414503", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as the issue cannot be reproduced and due to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-21T21:54:44.000+0000", "updated": "2017-03-21T21:54:44.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }