{ "id": "174169", "key": "ALOY-1705", "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": "20873", "name": "CLI Release 7.1.2", "archived": false, "released": true } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2019-11-19T11:18:45.000+0000", "created": "2019-09-24T13:43:44.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [ { "id": "20860", "description": "", "name": "Alloy 1.14.1", "archived": false, "released": true, "releaseDate": "2019-08-19" } ], "issuelinks": [], "assignee": { "name": "bhouse", "key": "bhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "updated": "2019-11-19T11:18:45.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": "Test app attached\r\n\r\n1. go to `app/lib` and run `npm install`\r\n2. build app\r\n\r\nThe app will fail with `Alloy Compiler Failed` error\r\n\r\nRun in trace mode shows an error however if you delete the folder app/lib/node_modules/bl/test, rebuild the App and it will build and launch in the simulato successfully.\r\n\r\nThe error:\r\n\r\n{{[DEBUG] if (!process.env.SAUCE_KEY || !process.env.SAUCE_USER)\r\n[DEBUG] return console.log('SAUCE_KEY and/or SAUCE_USER not set, not running sauce tests')\r\n[DEBUG] if (!/v0\\.10/.test(process.version))\r\n[DEBUG] return console.log('Not Node v0.10.x, not running sauce tests')\r\n[DEBUG] require('./sauce.js')\r\n[DEBUG] \r\n[DEBUG] /Users/jkneen/.nvm/versions/node/v9.9.0/lib/node_modules/alloy/Alloy/commands/compile/sourceMapper.js:212\r\n[DEBUG] throw e;\r\n[DEBUG] ^\r\n[DEBUG] SyntaxError: 'return' outside of function (4:2)\r\n[DEBUG] at Parser.raise (/Users/jkneen/.nvm/versions/node/v9.9.0/lib/node_modules/alloy/node_modules/@babel/parser/lib/index.js:6325:17)\r\n[DEBUG] at Parser.parseReturnStatement (/Users/jkneen/.nvm/versions/node/v9.9.0/lib/node_modules/alloy/node_modules/@babel/parser/lib/index.js:10190:12)\r\n[DEBUG] at Parser.parseStatementContent (/Users/jkneen/.nvm/versions/node/v9.9.0/lib/node_modules/alloy/node_modules/@babel/parser/lib/index.js:9877:21)\r\n[DEBUG] at Parser.parseStatement (/Users/jkneen/.nvm/versions/node/v9.9.0/lib/node_modules/alloy/node_modules/@babel/parser/lib/index.js:9829:17)\r\n[DEBUG] at Parser.parseIfStatement (/Users/jkneen/.nvm/versions/node/v9.9.0/lib/node_modules/alloy/node_modules/@babel/parser/lib/index.js:10183:28)\r\n[DEBUG] at Parser.parseStatementContent (/Users/jkneen/.nvm/versions/node/v9.9.0/lib/node_modules/alloy/node_modules/@babel/parser/lib/index.js:9874:21)\r\n[DEBUG] at Parser.parseStatement (/Users/jkneen/.nvm/versions/node/v9.9.0/lib/node_modules/alloy/node_modules/@babel/parser/lib/index.js:9829:17)\r\n[DEBUG] at Parser.parseBlockOrModuleBlockBody (/Users/jkneen/.nvm/versions/node/v9.9.0/lib/node_modules/alloy/node_modules/@babel/parser/lib/index.js:10405:25)\r\n[DEBUG] at Parser.parseBlockBody (/Users/jkneen/.nvm/versions/node/v9.9.0/lib/node_modules/alloy/node_modules/@babel/parser/lib/index.js:10392:10)\r\n[DEBUG] at Parser.parseTopLevel (/Users/jkneen/.nvm/versions/node/v9.9.0/lib/node_modules/alloy/node_modules/@babel/parser/lib/index.js:9758:10)\r\n[DEBUG] at Parser.parse (/Users/jkneen/.nvm/versions/node/v9.9.0/lib/node_modules/alloy/node_modules/@babel/parser/lib/index.js:11270:17)\r\n[DEBUG] at Object.parse (/Users/jkneen/.nvm/versions/node/v9.9.0/lib/node_modules/alloy/node_modules/@babel/parser/lib/index.js:11306:38)\r\n[DEBUG] at Object.exports.generateSourceMap (/Users/jkneen/.nvm/versions/node/v9.9.0/lib/node_modules/alloy/Alloy/commands/compile/sourceMapper.js:206:17)\r\n[DEBUG] at /Users/jkneen/.nvm/versions/node/v9.9.0/lib/node_modules/alloy/Alloy/utils.js:292:17\r\n[DEBUG] at arrayEach (/Users/jkneen/.nvm/versions/node/v9.9.0/lib/node_modules/alloy/node_modules/lodash/lodash.js:516:11)\r\n[DEBUG] at Function.forEach (/Users/jkneen/.nvm/versions/node/v9.9.0/lib/node_modules/alloy/node_modules/lodash/lodash.js:9342:14)\r\n[DEBUG] at Object.exports.updateFiles (/Users/jkneen/.nvm/versions/node/v9.9.0/lib/node_modules/alloy/Alloy/utils.js:249:4)\r\n[DEBUG] at updateFilesWithBuildLog (/Users/jkneen/.nvm/versions/node/v9.9.0/lib/node_modules/alloy/Alloy/commands/compile/index.js:1114:24)\r\n[DEBUG] at /Users/jkneen/.nvm/versions/node/v9.9.0/lib/node_modules/alloy/Alloy/commands/compile/index.js:263:3\r\n[DEBUG] at arrayEach (/Users/jkneen/.nvm/versions/node/v9.9.0/lib/node_modules/alloy/node_modules/lodash/lodash.js:516:11)\r\n[DEBUG] at Function.forEach (/Users/jkneen/.nvm/versions/node/v9.9.0/lib/node_modules/alloy/node_modules/lodash/lodash.js:9342:14)\r\n[DEBUG] at module.exports (/Users/jkneen/.nvm/versions/node/v9.9.0/lib/node_modules/alloy/Alloy/commands/compile/index.js:262:4)\r\n[DEBUG] at Object. (/Users/jkneen/.nvm/versions/node/v9.9.0/lib/node_modules/alloy/Alloy/alloy.js:112:46)\r\n[DEBUG] at Module._compile (module.js:649:30)\r\n[DEBUG] at Object.Module._extensions..js (module.js:660:10)\r\n[DEBUG] at Module.load (module.js:561:32)\r\n[DEBUG] at tryModuleLoad (module.js:501:12)\r\n[DEBUG] at Function.Module._load (module.js:493:3)\r\n[DEBUG] at Module.require (module.js:593:17)\r\n[DEBUG] at require (internal/module.js:11:18)\r\n[DEBUG] at Object. (/Users/jkneen/.nvm/versions/node/v9.9.0/lib/node_modules/alloy/bin/alloy:3:1)\r\n[DEBUG] at Module._compile (module.js:649:30)\r\n[DEBUG] at Object.Module._extensions..js (module.js:660:10)\r\n[DEBUG] at Module.load (module.js:561:32)\r\n[DEBUG] at tryModuleLoad (module.js:501:12)\r\n[DEBUG] at Function.Module._load (module.js:493:3)\r\n[DEBUG] at Function.Module.runMain (module.js:690:10)\r\n[DEBUG] at startup (bootstrap_node.js:194:16)\r\n[DEBUG] at bootstrap_node.js:666:3\r\n[ERROR] Alloy compiler failed}}\r\n", "attachment": [ { "id": "66965", "filename": "npmtest.zip", "author": { "name": "jkneen", "key": "jkneen", "displayName": "Jason Kneen", "active": false, "timeZone": "Africa/Ceuta" }, "created": "2019-09-24T13:45:35.000+0000", "size": 8849395, "mimeType": "application/zip" } ], "flagged": false, "summary": "Fix issue with return outside of function when using npm packages", "creator": { "name": "jkneen", "key": "jkneen", "displayName": "Jason Kneen", "active": false, "timeZone": "Africa/Ceuta" }, "subtasks": [], "reporter": { "name": "jkneen", "key": "jkneen", "displayName": "Jason Kneen", "active": false, "timeZone": "Africa/Ceuta" }, "environment": "macOS 10.14.6\r\nNode v9.9.0\r\nAlloy 1.14.0\r\nTitanium 5.2.1", "comment": { "comments": [ { "id": "451605", "author": { "name": "bhouse", "key": "bhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "body": "Created PR: https://github.com/appcelerator/alloy/pull/938", "updateAuthor": { "name": "bhouse", "key": "bhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "created": "2019-09-24T14:30:58.000+0000", "updated": "2019-09-24T14:30:58.000+0000" }, { "id": "452777", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*Closing ticket.* Fix verified in CLI Version {{\"NPM\":\"4.2.15-1\",\"CLI\":\"7.1.2-7\"}}. Tested using the instructions above and no longer get the above error. \r\n\r\n*Test Environment*\r\n{code:java}\r\nMacOS Catalina 10.15.1 beta\r\nXcode 11 \r\nNode.js 10.16.3\r\niPhone 7 Sim(12.2)\r\n\"NPM\":\"4.2.15-1\",\"CLI\":\"7.1.2-7\"\r\nSDK Version 8.1.1.GA\r\n{code}\r\n", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-11-19T11:18:09.000+0000", "updated": "2019-11-19T11:18:28.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }