{ "id": "171668", "key": "TIMOB-26171", "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": "2018-05-17T14:02:24.000+0000", "priority": null, "labels": [], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-06-29T21:30:08.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": "13103", "name": "CLI", "description": "Node-based command line interface" } ], "description": "Upgrading to 7.1.1.GA and trying to carry out commands with the CLI and receiving a thrown error \"TypeError: Cannot read property 'version' of undefined, full error output is below.\r\n\r\nI can build with exact same setup on Titanium 7.1.0.GA, so most likely an underlying library change between the two versions.\r\n\r\nOSX 10.13.4\r\nAppc CLI 7.0.3\r\nTitanium 7.1.1.GA\r\nTitanium CLI 5.1.0\r\nNode 8.11.2\r\nNPM 6.0.1\r\n\r\n{code:java}\r\n/Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:1034\r\n callback();\r\n ^\r\nTypeError: Cannot read property 'version' of undefined\r\n at /Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/node-appc/lib/jdk.js:258:23\r\n at Array.forEach ()\r\n at /Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/node-appc/lib/jdk.js:257:10\r\n at /Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:3824:9\r\n at /Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:460:16\r\n at iteratorCallback (/Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:1034:13)\r\n at /Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:944:16\r\n at /Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:3821:13\r\n at apply (/Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:21:25)\r\n at /Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:56:12\r\n---------------------------------------------\r\n at run (/Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/node-appc/lib/subprocess.js:60:8)\r\n at finalize (/Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/node-appc/lib/jdk.js:226:8)\r\n at /Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/node-appc/lib/jdk.js:244:14\r\n at ChildProcess. (/Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/node-appc/lib/subprocess.js:61:3)\r\n at emitTwo (events.js:126:13)\r\n at ChildProcess.emit (events.js:214:7)\r\n at maybeClose (internal/child_process.js:925:16)\r\n at Socket.stream.socket.on (internal/child_process.js:346:11)\r\n---------------------------------------------\r\n at run (/Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/node-appc/lib/subprocess.js:60:8)\r\n at /Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/node-appc/lib/jdk.js:241:5\r\n at /Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:3816:26\r\n at eachOfArrayLike (/Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:1039:9)\r\n at eachOf (/Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:1087:5)\r\n at _parallel (/Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:3815:5)\r\n at Object.parallelLimit [as parallel] (/Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:3898:3)\r\n at /Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/node-appc/lib/jdk.js:178:9\r\n at /Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:3824:9\r\n---------------------------------------------\r\n at Object.run (/Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/node-appc/lib/subprocess.js:60:8)\r\n at find (/Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/node-appc/lib/subprocess.js:97:13)\r\n at /Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:4025:5\r\n at process (/Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:2332:17)\r\n at Immediate. (/Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:2136:16)\r\n at runCallback (timers.js:810:20)\r\n at tryOnImmediate (timers.js:768:5)\r\n at processImmediate [as _immediateCallback] (timers.js:745:5)\r\n---------------------------------------------\r\n at /Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:2135:9\r\n at apply (/Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:21:25)\r\n at /Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:56:12\r\n at _insert (/Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:2248:9)\r\n at Object.push (/Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:2294:13)\r\n at findExecutable (/Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/node-appc/lib/subprocess.js:114:8)\r\n at /Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/node-appc/lib/jdk.js:145:5\r\n at ChildProcess. (/Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/node-appc/lib/subprocess.js:61:3)\r\n---------------------------------------------\r\n at run (/Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/node-appc/lib/subprocess.js:60:8)\r\n at detectOSX (/Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/node-appc/lib/jdk.js:139:4)\r\n at /Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:3816:26\r\n at replenish (/Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:982:17)\r\n at iterateeCallback (/Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:967:17)\r\n at /Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:944:16\r\n at /Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:3821:13\r\n at apply (/Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:21:25)\r\n at /Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/async/dist/async.js:56:12\r\n---------------------------------------------\r\n at Object.run (/Users/luketaylor/.nvm/versions/node/v8.11.2/lib/node_modules/titanium/node_modules/node-appc/lib/subprocess.js:59:8)\r\n at find (/Users/luketaylor/.nvm/versions/node/v8.11.2/lib/node_modules/titanium/node_modules/node-appc/lib/subprocess.js:96:14)\r\n at /Users/luketaylor/.nvm/versions/node/v8.11.2/lib/node_modules/titanium/node_modules/node-appc/node_modules/async/dist/async.js:3894:5\r\n at process (/Users/luketaylor/.nvm/versions/node/v8.11.2/lib/node_modules/titanium/node_modules/node-appc/node_modules/async/dist/async.js:2299:17)\r\n at Immediate. (/Users/luketaylor/.nvm/versions/node/v8.11.2/lib/node_modules/titanium/node_modules/node-appc/node_modules/async/dist/async.js:2112:16)\r\n at runCallback (timers.js:810:20)\r\n at tryOnImmediate (timers.js:768:5)\r\n at processImmediate [as _immediateCallback] (timers.js:745:5)\r\n{code}\r\n\"", "attachment": [], "flagged": false, "summary": "7.1.1.GA throwing error - Cannot read property 'version' of undefined", "creator": { "name": "ltaylor", "key": "ltaylor", "displayName": "Luke Taylor", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "ltaylor", "key": "ltaylor", "displayName": "Luke Taylor", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "437731", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "I think it's possible that https://github.com/appcelerator/node-appc/pull/126 fixes this issue\r\n\r\n[~ltaylor] could you try two things for me please\r\n\r\n1. Open {{/Users/luketaylor/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA/node_modules/node-appc/lib/jdk.js}}, could you change the code in the forEach loop on line 257 to be \r\n\r\n{code}\r\nconsole.log(jdk);\r\nresults.jdks[jdk.version + '_' + jdk.build] = jdk;\r\n\r\n// only add the first jdk as it's probably the JAVA_HOME based one\r\n\tif (results.version === null) {\r\n\t\tmix(results, jdk);\r\n\t}\r\n});\r\n{code}\r\n\r\n2. Could you try the patch in https://github.com/appcelerator/node-appc/pull/126, on line 256 before {{if (jdks.length)}} add {{jdks = jdks.filter(function (jdk) \\{ return jdk; \\});}}", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2018-05-17T14:19:40.000+0000", "updated": "2018-05-17T14:19:40.000+0000" }, { "id": "437732", "author": { "name": "ltaylor", "key": "ltaylor", "displayName": "Luke Taylor", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Ewan Harris Was unsure what difference other than the console.log was from (1), but I have patched in (2) and that has done the trick!", "updateAuthor": { "name": "ltaylor", "key": "ltaylor", "displayName": "Luke Taylor", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-05-17T14:48:24.000+0000", "updated": "2018-05-17T14:48:24.000+0000" }, { "id": "437733", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "[~ltaylor] Oops I forgot to ask you upload the output from the console.logs :), could you maybe do that? I have a feeling that this maybe should be fixed earlier in the code than the code in 2", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2018-05-17T14:52:21.000+0000", "updated": "2018-05-17T14:52:21.000+0000" }, { "id": "437734", "author": { "name": "ltaylor", "key": "ltaylor", "displayName": "Luke Taylor", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Okay, I have logged before and after the filter happens...\r\n\r\nBefore\r\n\r\n{code:java}\r\n[ undefined,\r\n { home: '/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home',\r\n version: '9.0.4',\r\n build: '11',\r\n executables: \r\n { java: '/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home/bin/java',\r\n javac: '/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home/bin/javac',\r\n keytool: '/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home/bin/keytool',\r\n jarsigner: '/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home/bin/jarsigner' },\r\n architecture: '64bit' },\r\n undefined,\r\n undefined ]\r\n{code}\r\n\r\nAfter\r\n\r\n{code:java}\r\n[ { home: '/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home',\r\n version: '9.0.4',\r\n build: '11',\r\n executables: \r\n { java: '/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home/bin/java',\r\n javac: '/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home/bin/javac',\r\n keytool: '/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home/bin/keytool',\r\n jarsigner: '/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home/bin/jarsigner' },\r\n architecture: '64bit' } ]\r\n{code}", "updateAuthor": { "name": "ltaylor", "key": "ltaylor", "displayName": "Luke Taylor", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-05-17T15:00:17.000+0000", "updated": "2018-05-17T15:00:17.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }