{ "id": "168948", "key": "AC-5083", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2017-08-08T19:53:55.000+0000", "created": "2017-07-14T06:19:36.000+0000", "labels": [ "liveview" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-08-08T19:53:55.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "When I run an app with Alloy.Globals defined in alloy.js I get an {{undefined is not an object}} error when the liveview updates for the first time. The first compile run is working fine.\r\n\r\nindex.js\r\n{code:java}\r\nconsole.log(Alloy.Globals.device.height + \" - \" + Alloy.Globals.device.width);\r\n$.index.open();\r\n{code}\r\n\r\n*index.xml*\r\n{code:xml}\r\n\r\n\t\r\n\t\r\n\r\n{code}\r\n\r\n\r\n*alloy.js*\r\n{code:java}\r\nAlloy.Globals.device = {\r\n\theight: 100,\r\n\twidth: 100\r\n}\r\n{code}\r\n\r\n*Output*\r\n{code}\r\n [INFO] test_liveview/1.0 (6.1.1.c28220a)\r\n [LiveView] Client connected\r\n [INFO] 100 100\r\n [LiveView] Alloy recompile initiated for ios\r\n [LiveView] Reload Triggered\r\n REASON: File Changed\r\n FILE: /Users/Development/test_liveview/app/controllers/index.js\r\n [LiveView] Reload Triggered\r\n REASON: File Changed\r\n FILE: /Users/Development/test_liveview/Resources/iphone/alloy/sync/sql.js\r\n[INFO] [LiveView] Reloading App\r\n[INFO] UI SHUTDOWN COMPLETE. TRYING TO RESUME RESTART\r\n[INFO] test_liveview/1.0 (6.1.1.c28220a)\r\n [LiveView] Client connected\r\n [LiveView] Client disconnected\r\n [INFO] [LiveView] Error Evaluating app.js @ Line: 28\r\n [ERROR] TypeError: undefined is not an object (evaluating 'Alloy.Globals.device.height')\r\n [ERROR] File: app.js\r\n [ERROR] Line: 28\r\n [ERROR] SourceId: \r\n [ERROR] Backtrace:\r\n [ERROR] undefined\r\n{code}\r\n\r\nTi SDK 6.1.1.GA\r\nLiveview iOS Simulator", "attachment": [], "flagged": false, "summary": "Liveview: Alloy.Globals undefined in 2nd run", "creator": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "425265", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, I can't reproduce the issue with SDK 6.1.1.GA. Here is my log. At first I run the app with liveview enabled and got [INFO] 100 --- 100 output. Next i add -- and save index.js file and got the [INFO] 100 ----- 100 output. Thanks.\r\n{code}\r\n[INFO] hella/1.0 (6.1.1.c28220a)\r\n [LiveView] Client connected\r\n[INFO] 100 --- 100\r\n [LiveView] Alloy recompile initiated for ios\r\n [LiveView] Reload Triggered\r\n REASON: File Changed\r\n FILE: /Users/sharifabudarda/Documents/Appcelerator_Studio_Workspace/hella/ap\r\np/controllers/index.js\r\n[INFO] [LiveView] Reloading App\r\n [LiveView] Client disconnected\r\n[INFO] UI SHUTDOWN COMPLETE. TRYING TO RESUME RESTART\r\n[INFO] hella/1.0 (6.1.1.c28220a)\r\n [LiveView] Client connected\r\n[INFO] 100 ----- 100\r\n{code}\r\nI got the expected output. ", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-08-02T15:12:58.000+0000", "updated": "2017-08-02T15:12:58.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }