{"action":"created","issue":{"url":"https://api.github.com/repos/firebase/angularfire/issues/591","labels_url":"https://api.github.com/repos/firebase/angularfire/issues/591/labels{/name}","comments_url":"https://api.github.com/repos/firebase/angularfire/issues/591/comments","events_url":"https://api.github.com/repos/firebase/angularfire/issues/591/events","html_url":"https://github.com/firebase/angularfire/issues/591","id":63111372,"number":591,"title":"Page freezes and cannot load","user":{"login":"kornicameister","id":1029674,"avatar_url":"https://avatars.githubusercontent.com/u/1029674?v=3","gravatar_id":"","url":"https://api.github.com/users/kornicameister","html_url":"https://github.com/kornicameister","followers_url":"https://api.github.com/users/kornicameister/followers","following_url":"https://api.github.com/users/kornicameister/following{/other_user}","gists_url":"https://api.github.com/users/kornicameister/gists{/gist_id}","starred_url":"https://api.github.com/users/kornicameister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kornicameister/subscriptions","organizations_url":"https://api.github.com/users/kornicameister/orgs","repos_url":"https://api.github.com/users/kornicameister/repos","events_url":"https://api.github.com/users/kornicameister/events{/privacy}","received_events_url":"https://api.github.com/users/kornicameister/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-19T23:03:37Z","updated_at":"2015-03-21T19:10:44Z","closed_at":"2015-03-21T19:10:44Z","body":"Hi,\r\n\r\nI am experiencing a very strange bug with AngularFire and/or Firebase itself. Since this repository is located under firebase I believe this might be a good place to start with.\r\n\r\nOk, let's get going. \r\nI've created a very simple factory which would allow me to create several instances of **angularFire** components without a need to constantly refer to the firebase url. Therefore I present my code snippets \r\n\r\n```javascript\r\nangular\r\n    .module('sg.data', ['firebase'])\r\n    .constant('DATA_URL', 'my_cool_firebase_url');\r\n\r\nangular\r\n    .module('sg.data')\r\n    .factory('sgDataFactory', [\r\n        'DATA_URL',\r\n        '$firebaseAuth',\r\n        function (DATA_URL, $firebaseAuth) {\r\n            var service = {};\r\n\r\n            service.firebaseAuth = _.wrap(getFirebaseAuth.bind(service), refWrapper);\r\n\r\n            return service;\r\n\r\n            function getFirebaseAuth(ref) {\r\n                debugger;\r\n                return $firebaseAuth(ref)\r\n            }\r\n\r\n            function refWrapper(func) {\r\n                return func(getFirebaseRef())\r\n            }\r\n\r\n            function getFirebaseRef() {\r\n                return new Firebase(DATA_URL)\r\n            }\r\n        }]\r\n);\r\n```\r\n\r\nProblem is that as long as I provide a valid URL and try to open my page locally either using [browserSync](http://www.browsersync.io/) or WebStorm builtin server my application fails to load completely. By failure I mean that it freezes on loading it. I am able to see my files loaded from under serve directory but I cannot see the content, and the tab itself starts to consume CPU like crazy causing entire tab inaccessible and forcing me to shut it down by force. There are no Angular specific issues in the console (I am able to see them as long as firebase url is set to empty string/undefined value) so I assume entire build process is valid and produces deployable code.\r\n\r\nAs for the environment and the background of the problem. While I was building an app on top of the RequireJS, everything was ok, where for the application built with a little **Gulp** help, well...I cannot verify if app is actually working.\r\n\r\nIf You'd like to take a look on my gulp tasks or any other stuff required to reproduce it, let me know."},"comment":{"url":"https://api.github.com/repos/firebase/angularfire/issues/comments/84423929","html_url":"https://github.com/firebase/angularfire/issues/591#issuecomment-84423929","issue_url":"https://api.github.com/repos/firebase/angularfire/issues/591","id":84423929,"user":{"login":"kornicameister","id":1029674,"avatar_url":"https://avatars.githubusercontent.com/u/1029674?v=3","gravatar_id":"","url":"https://api.github.com/users/kornicameister","html_url":"https://github.com/kornicameister","followers_url":"https://api.github.com/users/kornicameister/followers","following_url":"https://api.github.com/users/kornicameister/following{/other_user}","gists_url":"https://api.github.com/users/kornicameister/gists{/gist_id}","starred_url":"https://api.github.com/users/kornicameister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kornicameister/subscriptions","organizations_url":"https://api.github.com/users/kornicameister/orgs","repos_url":"https://api.github.com/users/kornicameister/repos","events_url":"https://api.github.com/users/kornicameister/events{/privacy}","received_events_url":"https://api.github.com/users/kornicameister/received_events","type":"User","site_admin":false},"created_at":"2015-03-21T19:10:44Z","updated_at":"2015-03-21T19:10:44Z","body":"Hey Kato,\r\n\r\nIt seems that the root cause wasn't in the AngularFire or even in the code related to the snippet above. I made a typo somewhere else inside while loop. By typo I mean extra exclamation mark (!). \r\nAfter I figure that out and changed the problematic line everything started to working. \r\n\r\nSo I guess that's a lesson to be remembered for future. Always look starting from yourself. \r\n\r\nSorry for causing troubles. \r\n\r\nBest regards,\r\nTomasz"}}