{ "id": "128167", "key": "AC-3321", "fields": { "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2014-07-29T07:00:35.000+0000", "created": "2014-03-26T03:23:02.000+0000", "labels": [ "defect" ], "versions": [], "issuelinks": [], "assignee": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "updated": "2016-03-08T07:57: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": [ { "id": "14544", "name": "Alloy", "description": "Please enter tickets related to the Alloy here." } ], "description": "I tried Alloy with HTML parser based on http://developer.appcelerator.com/question/60731/what-is-the-best-way-to-parse-html\r\nIt works at the beginning and then after going to background and foreground it doesnt work. And causes this error \"'undefined' is not a constructor (evaluating 'new htmlparser.DefaultHandler')\";\r\n\r\nYou can download this sample app I made: https://github.com/axilaris/testnavhtmlparser\r\n\r\nthis is the parsing code: https://github.com/axilaris/testnavhtmlparser/blob/master/app/controllers/nextwin.js\r\n\r\nthis is how I call push the window https://github.com/axilaris/testnavhtmlparser/blob/master/app/controllers/index.js\r\n\r\nhere are the parsing code: https://github.com/axilaris/testnavhtmlparser/tree/master/app/assets/lib\r\n\r\nSteps to reproduce: \r\n1. click nextWindow \r\n2. click getPageandParse - no problem parsing \r\n3. click back - i even tried explicitly closing the window with .close(), didnt work \r\n4. click getPageandParse - the error below pops up\r\n\r\nError output: \r\n\"'undefined' is not a constructor (evaluating 'new htmlparser.DefaultHandler')\";\r\n\r\n\r\nerror dump [ERROR] : Script Error { [ERROR] : backtrace = \"#0 () at :0\"; [ERROR] : line = 17; [ERROR] : message = \"'undefined' is not a constructor (evaluating 'new htmlparser.DefaultHandler')\"; [ERROR] : name = TypeError; [ERROR] : sourceId = 276543488; [ERROR] : sourceURL = \"file:///Users/test/Library/Application%20Support/iPhone%20Simulator/7.0.3-64/Applications/9D672583-9B94-45E8-A75F-9EE090202C13/testnavhtmlparser.app/alloy/controllers/nextwin.js\"; \r\n\r\n\r\nI tried backslash on Ti.include, I tried to that particular window. This always happen when the window goes to background and foreground again. Very strange.\r\n\r\nTitanium SDK 3.2.2 GA\r\nTitanium Studio, build: 3.2.1.201402041146\r\nOSX 10.9.2\r\nIOS 7\r\nXCode 5.0.2\r\n\r\n", "attachment": [], "flagged": false, "summary": "Alloy with HTML Parser not working certain use case - \"'undefined' is not a constructor", "creator": { "name": "axilaris", "key": "axilaris", "displayName": "Axil Rolce", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "axilaris", "key": "axilaris", "displayName": "Axil Rolce", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK 3.2.2 GA\r\nTitanium Studio, build: 3.2.1.201402041146\r\nOSX 10.9.2\r\nIOS 7\r\nXCode 5.0.2\r\n\r\n", "comment": { "comments": [ { "id": "312784", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\n\r\nWe have tested this sample code. This is not titanium bug. Its report coding issue. \r\n\r\n As per our docs, include mechanism is not supported with Alloy projects.\r\n \r\nWe recommended instead of include method please create a CommonJS module and use the require () method to include external JavaScript code.\r\n \r\nFor more information please visit following link: http://docs.appcelerator.com/platform/latest/#!/api/Titanium-method-include\r\n\r\nThanks \r\n", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2014-07-08T06:05:35.000+0000", "updated": "2014-07-29T07:00:06.000+0000" }, { "id": "316107", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Please don't use include in Alloy. ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2014-07-29T07:00:35.000+0000", "updated": "2014-07-29T07:00:35.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }