{"action":"created","issue":{"url":"https://api.github.com/repos/driftyco/ionic/issues/6918","repository_url":"https://api.github.com/repos/driftyco/ionic","labels_url":"https://api.github.com/repos/driftyco/ionic/issues/6918/labels{/name}","comments_url":"https://api.github.com/repos/driftyco/ionic/issues/6918/comments","events_url":"https://api.github.com/repos/driftyco/ionic/issues/6918/events","html_url":"https://github.com/driftyco/ionic/issues/6918","id":160391981,"number":6918,"title":"Popover Dismiss Causes “RangeError: Maximum call stack size exceeded” on Android Device","user":{"login":"ehussain","id":358413,"avatar_url":"https://avatars.githubusercontent.com/u/358413?v=3","gravatar_id":"","url":"https://api.github.com/users/ehussain","html_url":"https://github.com/ehussain","followers_url":"https://api.github.com/users/ehussain/followers","following_url":"https://api.github.com/users/ehussain/following{/other_user}","gists_url":"https://api.github.com/users/ehussain/gists{/gist_id}","starred_url":"https://api.github.com/users/ehussain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehussain/subscriptions","organizations_url":"https://api.github.com/users/ehussain/orgs","repos_url":"https://api.github.com/users/ehussain/repos","events_url":"https://api.github.com/users/ehussain/events{/privacy}","received_events_url":"https://api.github.com/users/ehussain/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/driftyco/ionic/labels/needs%20reply","name":"needs reply","color":"ededed"},{"url":"https://api.github.com/repos/driftyco/ionic/labels/popover","name":"popover","color":"006b75"},{"url":"https://api.github.com/repos/driftyco/ionic/labels/v2","name":"v2","color":"313744"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-06-15T10:44:53Z","updated_at":"2016-06-20T15:03:08Z","closed_at":null,"body":"I am using ionic2 beta8. \r\n\r\nI have copied exact usage example from http://ionicframework.com/docs/v2/2.0.0-beta.8/api/components/popover/Popover/#usage\r\n\r\nThe only thing I changed is I have created separate files for `popover.ts` `popover.html`. \r\n\r\nAfter all those changes everything worked fine in browser. But when I test that in Android device, when I try to dismiss the popover (either by calling `this.viewController.dismiss()` method or clicking on backdrop) I see that UI hung up and nothing happens. \r\n\r\nI checked logs in Android Monitoring tool then I found following exception in log.\r\n\r\n\r\n----------\r\n\r\n```text\r\n\r\n[INFO:CONSOLE(34947)] \"EXCEPTION: Error in ./PopoverCmp class PopoverCmp - inline template:0:14\", source: file:///android_asset/www/build/js/app.bundle.js (34947)\r\n[INFO:CONSOLE(34947)] \"ORIGINAL EXCEPTION: RangeError: Maximum call stack size exceeded\", source: file:///android_asset/www/build/js/app.bundle.js (34947)\r\n[INFO:CONSOLE(34947)] \"ORIGINAL STACKTRACE:\", source: file:///android_asset/www/build/js/app.bundle.js (34947)\r\n[INFO:CONSOLE(34947)] \"RangeError: Maximum call stack size exceeded\r\n    at Object.re.RequireObjectCoercible (file:///android_asset/www/build/js/es6-shim.min.js)\r\n    at Object.re.ToObject (file:///android_asset/www/build/js/es6-shim.min.js:10:4947)\r\n    at Function.keys (file:///android_asset/www/build/js/es6-shim.min.js:10:24378)\r\n    at _baseExtend (file:///android_asset/www/build/js/app.bundle.js:69658:27)\r\n    at _baseExtend (file:///android_asset/www/build/js/app.bundle.js:69665:17)\r\n    at _baseExtend (file:///android_asset/www/build/js/app.bundle.js:69665:17)\r\n    at _baseExtend (file:///android_asset/www/build/js/app.bundle.js:69665:17)\r\n    at _baseExtend (file:///android_asset/www/build/js/app.bundle.js:69665:17)\r\n    at _baseExtend (file:///android_asset/www/build/js/app.bundle.js:69665:17)\r\n    at _baseExtend (file:///android_asset/www/build/js/app.bundle.js:69665:17)\", source: file:///android_asset/www/build/js/app.bundle.js (34947)\r\n[INFO:CONSOLE(34947)] \"ERROR CONTEXT:\", source: file:///android_asset/www/build/js/app.bundle.js (34947)\r\n[INFO:CONSOLE(34947)] \"[object Object]\", source: file:///android_asset/www/build/js/app.bundle.js (34947)\r\n[INFO:CONSOLE(260)] \"Uncaught EXCEPTION: Error in ./PopoverCmp class PopoverCmp - inline template:0:14\r\nORIGINAL EXCEPTION: RangeError: Maximum call stack size exceeded\r\nORIGINAL STACKTRACE:\r\nRangeError: Maximum call stack size exceeded\r\n    at Object.re.RequireObjectCoercible (file:///android_asset/www/build/js/es6-shim.min.js)\r\n    at Object.re.ToObject (file:///android_asset/www/build/js/es6-shim.min.js:10:4947)\r\n    at Function.keys (file:///android_asset/www/build/js/es6-shim.min.js:10:24378)\r\n    at _baseExtend (file:///android_asset/www/build/js/app.bundle.js:69658:27)\r\n    at _baseExtend (file:///android_asset/www/build/js/app.bundle.js:69665:17)\r\n    at _baseExtend (file:///android_asset/www/build/js/app.bundle.js:69665:17)\r\n    at _baseExtend (file:///android_asset/www/build/js/app.bundle.js:69665:17)\r\n    at _baseExtend (file:///android_asset/www/build/js/app.bundle.js:69665:17)\r\n    at _baseExtend (file:///android_asset/www/build/js/app.bundle.js:69665:17)\r\n    at _baseExtend (file:///android_asset/www/build/js/app.bundle.js:69665:17)\r\nERROR CONTEXT:\r\n[object Object]\", source: file:///android_asset/www/build/js/zone.js (260)\r\nDebugger is no longer active\r\n\r\n\r\n```\r\n\r\nHere is code I am using\r\n\r\n```\r\nimport { Component } from '@angular/core';\r\nimport { App, NavController, NavParams, MenuController, Popover, ViewController } from \"ionic-angular\";\r\nimport { Storage, LocalStorage } from 'ionic-angular';\r\n\r\nimport { AuthService } from \"./../../../services/user/auth\";\r\nimport { AuthModel } from \"./../../../models/user/auth\";\r\n\r\n\r\n@Component({\r\n\ttemplate: `\r\n\t\t<ion-list>\r\n\t\t\t<ion-list-header>Welcome</ion-list-header>\r\n\t\t\t<button ion-item (click)=\"onLogout($event)\">Logout</button>\r\n\t\t</ion-list>\r\n\t`,\r\n\tproviders: []\r\n})\r\nclass PopoverPage {\r\n\tprivate storage;\r\n\r\n\tconstructor(private viewController: ViewController, private nav: NavController, private authService: AuthService, private auth: AuthModel) {\r\n\t\tthis.storage = new Storage(LocalStorage);\r\n\t}\r\n\r\n\tclose() {\r\n\t\tconsole.log('On Close Popover');\r\n\t\tthis.viewController.dismiss();\r\n\t}\r\n\r\n\tonLogout() {\r\n\t\tthis.close();\r\n\t}\r\n}\r\n\r\n@Component({\r\n\ttemplateUrl: \"build/pages/app/dashboard/dashboard.html\",\r\n\tproviders: []\r\n})\r\nexport class DashboardNewPage {\r\n\tprivate storage;\r\n\r\n\tconstructor(protected app: App, protected nav: NavController, protected navParams: NavParams, private menu: MenuController, private authService: AuthService, private auth: AuthModel) {\r\n\t\tthis.storage = new Storage(LocalStorage);\r\n\t}\r\n\r\n\tpublic onPopover(event) {\r\n\t\tlet popover = Popover.create(PopoverPage);\r\n\t\tthis.nav.present(popover, {\r\n\t\t\tev: event\r\n\t\t});\r\n\t}\r\n}\r\n```\r\n\r\nonPopover function is getting called when nav button is triggered and that markup is present in dashboard.html\r\n\r\nThis page is rootPage of app and it gets loaded immediately.\r\n\r\nLast thing I see in logcat is 'console.log('On Close Popover');' execution. After that it shows exception.\r\n\r\nLet me know if I did something wrong here. Please note that this works perfectly fine in browser. But fails in android device.\r\n\r\n---------------\r\n\r\nI guess that the possible cause might be that:\r\n\r\nThe object that is passed to ToObject() method is too big - this will work on a desktop browser because it has bigger stack so it could handle it but obviously fails on mobile.\r\n\r\nIt might be an issue with the es6-shim ToObject() method (either a bug or it's not very effective or not optimized) - most desktop browsers should have a native implementation of this method and therefore it works fine but obviously on mobile there's no native implementation yet.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/driftyco/ionic/issues/comments/227169188","html_url":"https://github.com/driftyco/ionic/issues/6918#issuecomment-227169188","issue_url":"https://api.github.com/repos/driftyco/ionic/issues/6918","id":227169188,"user":{"login":"Geoffrey-D","id":8298145,"avatar_url":"https://avatars.githubusercontent.com/u/8298145?v=3","gravatar_id":"","url":"https://api.github.com/users/Geoffrey-D","html_url":"https://github.com/Geoffrey-D","followers_url":"https://api.github.com/users/Geoffrey-D/followers","following_url":"https://api.github.com/users/Geoffrey-D/following{/other_user}","gists_url":"https://api.github.com/users/Geoffrey-D/gists{/gist_id}","starred_url":"https://api.github.com/users/Geoffrey-D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Geoffrey-D/subscriptions","organizations_url":"https://api.github.com/users/Geoffrey-D/orgs","repos_url":"https://api.github.com/users/Geoffrey-D/repos","events_url":"https://api.github.com/users/Geoffrey-D/events{/privacy}","received_events_url":"https://api.github.com/users/Geoffrey-D/received_events","type":"User","site_admin":false},"created_at":"2016-06-20T15:03:08Z","updated_at":"2016-06-20T15:03:08Z","body":"Hey @jgw96, here is the repo : https://github.com/Geoffrey-D/issue-6918-temp. Everything should be in there (I did it fast). Tell me if you have any issue with it\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"Geoffrey-D"}}