{ "id": "174492", "key": "TIMOB-27633", "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": "20033", "name": "Release 9.0.0", "archived": false, "released": true, "releaseDate": "2020-03-18" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2020-01-13T11:00:39.000+0000", "created": "2019-11-26T19:19:27.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "android", "engSchedule" ], "versions": [ { "id": "19882", "name": "Release 8.0.0", "archived": false, "released": true, "releaseDate": "2019-03-14" } ], "issuelinks": [], "assignee": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "updated": "2020-01-13T11:00:39.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "*Steps to reproduce the behavior*\r\n\r\n# Create a new JS files that can be required, for example {{test.js}}. The content doesn't matter\r\n# Require that JS file with an additional parameter\r\n{code}\r\nrequire('./test.js', true);\r\n{code}\r\n# Run on Android\r\n\r\n*Actual behavior*\r\nThe app crashes during runtime with the following error:\r\n{code}\r\n[ERROR] TiExceptionHandler: (main) [157,157] ti:/module.js:596\r\n[ERROR] TiExceptionHandler: \tcontext.sourceUrl = url;\r\n[ERROR] TiExceptionHandler: ^\r\n[ERROR] TiExceptionHandler: TypeError: Cannot create property 'sourceUrl' on boolean 'true'\r\n[ERROR] TiExceptionHandler: at Module._runScript (ti:/module.js:596:20)\r\n[ERROR] TiExceptionHandler: at Module.load (ti:/module.js:107:7)\r\n[ERROR] TiExceptionHandler: at Module.loadJavascriptText (ti:/module.js:453:9)\r\n[ERROR] TiExceptionHandler: at Module.loadAsFile (ti:/module.js:503:15)\r\n[ERROR] TiExceptionHandler: at Module.loadAsFileOrDirectory (ti:/module.js:425:20)\r\n[ERROR] TiExceptionHandler: at Module.require (ti:/module.js:255:17)\r\n[ERROR] TiExceptionHandler: at Module.global.Module.require (/ti.main.js:9505:34)\r\n[ERROR] TiExceptionHandler: at require (ti:/module.js:566:15)\r\n[ERROR] TiExceptionHandler: at /app.js:20:1\r\n[ERROR] TiExceptionHandler: at Module._runScript (ti:/module.js:608:9)\r\n[ERROR] TiExceptionHandler:\r\n[ERROR] TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModuleBytes(Native Method)\r\n[ERROR] TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModuleBytes(V8Runtime.java:162)\r\n[ERROR] TiExceptionHandler: org.appcelerator.kroll.KrollRuntime.runModuleBytes(KrollRuntime.java:212)\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.TiLaunchActivity.loadScript(TiLaunchActivity.java:101)\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.TiRootActivity.loadScript(TiRootActivity.java:480)\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.TiLaunchActivity.onResume(TiLaunchActivity.java:192)\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.TiRootActivity.onResume(TiRootActivity.java:499)\r\n[ERROR] TiExceptionHandler: android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1355)\r\n[ERROR] TiExceptionHandler: android.app.Activity.performResume(Activity.java:7117)\r\n[ERROR] TiExceptionHandler: android.app.ActivityThread.performResumeActivity(ActivityThread.java:3556)\r\n{code}\r\n\r\n*Expected behavior*\r\nAdditional parameter to require will be ignored.\r\n\r\n*Additional notes*\r\nIf the file was required before without any additional parameters the require works as expected.\r\n\r\n{code}\r\n// This won't crash\r\nrequire('./test');\r\nrequire('./test', true);\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: Additional parameters in require cause app to crash", "creator": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "closedSprints": [ { "id": 1175, "state": "closed", "name": "2019 Sprint 26", "startDate": "2019-12-16T06:12:12.044Z", "endDate": "2019-12-21T06:12:00.000Z", "completeDate": "2019-12-22T03:07:15.802Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "453048", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~gmathews] put up a PR https://github.com/appcelerator/titanium_mobile/pull/11378 for a possible solution and further discussion.", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-12-06T12:14:47.000+0000", "updated": "2019-12-06T12:14:47.000+0000" }, { "id": "453068", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "WIP PR: https://github.com/appcelerator/titanium_mobile/pull/11380", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2019-12-06T19:50:14.000+0000", "updated": "2019-12-06T19:50:14.000+0000" }, { "id": "453209", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "https://github.com/appcelerator/titanium_mobile/pull/11380", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2019-12-16T21:45:11.000+0000", "updated": "2019-12-16T21:45:11.000+0000" }, { "id": "453637", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed, Waiting on Jenkins build.", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-01-10T15:48:13.000+0000", "updated": "2020-01-10T15:48:13.000+0000" }, { "id": "453638", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to master for 9.0.0", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2020-01-10T16:12:10.000+0000", "updated": "2020-01-10T16:12:10.000+0000" }, { "id": "453666", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*Closing ticket*, fix verified in SDK Version {{9.0.0.v20200110103446}}.\r\n\r\nTest and other information can be found at: \r\nhttps://github.com/appcelerator/titanium_mobile/pull/11380", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-01-13T11:00:30.000+0000", "updated": "2020-01-13T11:00:30.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }