{ "id": "168152", "key": "TIMOB-24791", "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": null, "resolutiondate": null, "created": "2017-06-07T09:14:07.000+0000", "priority": null, "labels": [], "versions": [ { "id": "16980", "description": "New V8", "name": "Release 6.0.0", "archived": false, "released": true, "releaseDate": "2016-11-15" }, { "id": "17608", "name": "Release 6.1.0", "archived": false, "released": true, "releaseDate": "2017-05-26" }, { "id": "19333", "description": "Patch release for important items that did not make it into 6.0.3", "name": "Release 6.0.4", "archived": false, "released": true, "releaseDate": "2017-04-27" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T19:55:03.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "Hello,\r\n\r\nI am facing an issue since the SDK 6_X_X on android , where i have the issue bellow\r\n\r\n*[ERROR] : TiExceptionHandler: (main) [125,125] ----- Titanium Javascript Runtime Error -----\r\n[ERROR] : TiExceptionHandler: (main) [0,125] - In ti:/module.js:303,2\r\n[ERROR] : TiExceptionHandler: (main) [0,125] - Message: Uncaught Error: Requested module not found: crypto-js/hmac\r\n[ERROR] : TiExceptionHandler: (main) [0,125] - Source: \tthrow new Error(\"Requested module not found: \" + request); // TODO Set 'code' property to 'MODULE_NOT_FOUND' to match Node?\r\n[ERROR] : V8Exception: Exception occurred at ti:/module.js:303: Uncaught Error: Requested module not found: crypto-js/hmac\r\n*\r\nThe same lib working fine on 5_5_X, could you please help me with this.\r\n\r\nBest regards.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n", "attachment": [], "flagged": false, "summary": "Android: SDK 6_X_X issue with local JS require", "creator": { "name": "bahinapster", "key": "bahinapster", "displayName": "Ibrahim MESLEM", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "bahinapster", "key": "bahinapster", "displayName": "Ibrahim MESLEM", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "421160", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hey there, is the same happening for 6.1.0.GA?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-06-07T10:23:49.000+0000", "updated": "2017-06-07T10:23:49.000+0000" }, { "id": "421161", "author": { "name": "bahinapster", "key": "bahinapster", "displayName": "Ibrahim MESLEM", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hey , yes :(", "updateAuthor": { "name": "bahinapster", "key": "bahinapster", "displayName": "Ibrahim MESLEM", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-06-07T10:28:16.000+0000", "updated": "2017-06-07T10:28:16.000+0000" }, { "id": "421163", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Thank you! Can you attach the file that caused the issue and an example code triggering the error as well?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-06-07T10:48:47.000+0000", "updated": "2017-06-07T10:48:47.000+0000" }, { "id": "421164", "author": { "name": "bahinapster", "key": "bahinapster", "displayName": "Ibrahim MESLEM", "active": true, "timeZone": "America/Los_Angeles" }, "body": "yes ofcourse,\r\nThis is the lib that im using\r\nhttps://drive.google.com/file/d/0B7S72-3VTSUfenZIb0xUOTBnUHM/view?usp=sharing\r\n\r\n\r\nvar CryptoJS = require(crypto-js/aes);\r\n\r\n\r\n\r\n", "updateAuthor": { "name": "bahinapster", "key": "bahinapster", "displayName": "Ibrahim MESLEM", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-06-07T10:58:48.000+0000", "updated": "2017-06-07T10:58:48.000+0000" }, { "id": "421170", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "[~bahinapster] We'd need to know the folder structure of your app (specifically the file calling require and the crypto-js/aes file).\r\n\r\n\"Legacy\"-style requires with no prefix should still be handled and assumed to be relative to your Resources folder (so {{require('crypto-js/aes')}} should look for {{Resources/crypto-js/aes.js}}) - but are now discouraged in favor of either explicitly absolute or relative require paths (i.e. {{require('./crypto-js/aes')}} to look relative to the current file, {{require('/crypto-js/aes')}} to look at {{Resources/crypto-js/aes.js}})", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2017-06-07T13:18:13.000+0000", "updated": "2017-06-07T13:18:13.000+0000" }, { "id": "421171", "author": { "name": "bahinapster", "key": "bahinapster", "displayName": "Ibrahim MESLEM", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Both lib and my file are under app/lib as bellow\r\napp/lib/crypto-js\r\napp/lib/myfile.js", "updateAuthor": { "name": "bahinapster", "key": "bahinapster", "displayName": "Ibrahim MESLEM", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-06-07T13:34:50.000+0000", "updated": "2017-06-07T13:34:50.000+0000" }, { "id": "421184", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Minimal test case\r\n\r\n# Add the below to your titanium project (assuming classic here)\r\n# Build for Android\r\n\r\n{code:title=app.js}\r\nvar CryptoJS = require('index');\r\nconsole.log(CryptoJS)\r\n{code}\r\n\r\n{code:title=index.js}\r\n;(function (root, factory) {\r\n\tmodule.exports = exports = factory();\r\n}(this, function (CryptoJS) {\r\n\t(function () {\r\n\t\tvar x = 'foo';\r\n\t}());\r\n}));\r\n{code}\r\n\r\n\r\n\r\nI am able to fix this by either removing the nested iife in index.js or returning that iife. I tried this on iOS and it appears to load fine, -I have not tried Windows-\r\n\r\nUpdate:\r\n\r\nWindow works as expected\r\nRemoved foo.js file as index.js is enough to repro", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2017-06-07T17:35:49.000+0000", "updated": "2017-06-07T20:13:04.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }