{ "id": "173921", "key": "ALOY-1698", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "20859", "description": "Alloy items that will be included in CLI 7.1.1", "name": "CLI Release 7.1.1", "archived": false, "released": true, "releaseDate": "2019-09-06" }, { "id": "20860", "description": "", "name": "Alloy 1.14.1", "archived": false, "released": true, "releaseDate": "2019-08-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2019-08-20T21:48:43.000+0000", "created": "2019-07-22T14:48:59.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "regression" ], "versions": [ { "id": "20836", "name": "Alloy 1.14.0", "archived": false, "released": true, "releaseDate": "2019-07-05" } ], "issuelinks": [], "assignee": { "name": "shaig", "key": "shaig", "displayName": "Samuel Haig", "active": true, "timeZone": "Europe/London" }, "updated": "2019-08-20T21:48:43.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": [], "description": "h5.Description\r\n\r\n*This is a regression due to ALOY-1629, as babel became stricter on syntax being \"more correct. There's nothing we can do to stop this being thrown, other than backing that out which imo we shouldnt do. We should prefer correctness*\r\n\r\nWhen we hit an error in the parsing of code in the sourcemap step we currently log it a trace level and rethrow it. This doesn't really help a user figure out what's wrong, we should handle it similarly to other babel processing errors where we construct a codeframe for the error and log that to give a user some context as to what the error is\r\n\r\nWe should be able to achieve this by using the [dieWithCodeFrame|https://github.com/appcelerator/alloy/blob/c63914c87610bcd1bc0e8be3426b160783a0991e/Alloy/utils.js#L535] function from utils, as the error is thrown by babel we should have the required info\r\n\r\nh5.Steps to reproduce\r\n\r\n1. Add the below to a file under lib\r\n{code}\r\nfunction getStoredAnswers() {\r\n\r\n}\r\n\r\nfunction getStoredAnswers() {\r\n\t\r\n}\r\n{code}\r\n2. Run a build for any platform\r\n\r\nh5.Actual\r\n\r\nThe build errors with a stacktrace, but no real useful info\r\n\r\nh5.Expected\r\n\r\nThe build should error with a codeframe to try and point a user to the right location and what the error is", "attachment": [], "flagged": false, "summary": "Compile: Errors thrown during sourcemap step are not visible to a user", "creator": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "subtasks": [], "reporter": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "environment": "Alloy 1.14.0", "closedSprints": [ { "id": 1153, "state": "closed", "name": "2019 Sprint 15", "startDate": "2019-07-15T18:30:38.331Z", "endDate": "2019-07-28T18:30:00.000Z", "completeDate": "2019-07-29T15:34:51.860Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "450478", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "PR: https://github.com/appcelerator/alloy/pull/935", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2019-08-14T15:57:43.000+0000", "updated": "2019-08-14T15:57:43.000+0000" }, { "id": "450653", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.\r\n\r\nBetter error is shown with the fix:\r\ne.g\r\n{code}\r\n[ERROR] : Error parsing code in app/lib/test.js. Identifier 'getStoredAnswers' has already been declared (9:9)\r\n[ERROR] : 7 |\r\n[ERROR] : 8 |\r\n[ERROR] : > 9 | function getStoredAnswers() {\r\n[ERROR] : | ^\r\n[ERROR] : 10 |\r\n[ERROR] : 11 |\r\n[ERROR] : 12 |\r\n[ERROR] : Alloy compiler failed\r\n[ERROR] Application Installer abnormal process termination. Process exit value was 1\r\n{code}\r\n\r\nClosing.\r\n\r\nStudio Ver: 5.1.3.201907112159\r\nSDK Ver: 8.1.1.v20190820115323\r\nOS Ver: 10.14.5\r\nXcode Ver: Xcode 11.0\r\nAppc NPM: 4.2.14\r\nAppc CLI: 7.1.1-master.5\r\nDaemon Ver: 1.1.3\r\nTi CLI Ver: 5.2.1\r\nAlloy Ver: 1.14.1\r\nNode Ver: 10.16.1\r\nNPM Ver: 6.9.0\r\nJava Ver: 10.0.2\r\nDevices: ⇨ google Pixel (Android 9)", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-08-20T21:48:24.000+0000", "updated": "2019-08-20T21:48:24.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }