{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/6443","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/6443/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/6443/comments","events_url":"https://api.github.com/repos/angular/angular/issues/6443/events","html_url":"https://github.com/angular/angular/issues/6443","id":126306994,"number":6443,"title":"No warning when calling router.navigate within a component constructor","user":{"login":"joeeames","id":1072285,"avatar_url":"https://avatars.githubusercontent.com/u/1072285?v=3","gravatar_id":"","url":"https://api.github.com/users/joeeames","html_url":"https://github.com/joeeames","followers_url":"https://api.github.com/users/joeeames/followers","following_url":"https://api.github.com/users/joeeames/following{/other_user}","gists_url":"https://api.github.com/users/joeeames/gists{/gist_id}","starred_url":"https://api.github.com/users/joeeames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joeeames/subscriptions","organizations_url":"https://api.github.com/users/joeeames/orgs","repos_url":"https://api.github.com/users/joeeames/repos","events_url":"https://api.github.com/users/joeeames/events{/privacy}","received_events_url":"https://api.github.com/users/joeeames/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular/angular/labels/comp:%20router","name":"comp: router","color":"c7def8"},{"url":"https://api.github.com/repos/angular/angular/labels/effort1:%20easy%20(hour)","name":"effort1: easy (hour)","color":"bfe5bf"},{"url":"https://api.github.com/repos/angular/angular/labels/P2:%20required","name":"P2: required","color":"fad8c7"},{"url":"https://api.github.com/repos/angular/angular/labels/type:%20bug","name":"type: bug","color":"EEEEEE"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-01-12T23:58:02Z","updated_at":"2016-02-27T19:14:29Z","closed_at":null,"body":"Currently, if you call the navigate function of the router within a component constructor, 1 of 2 things happens. Either it changes the route just fine, or it throws the following runtime error:\r\n\r\n TypeError: Cannot read property 'constructor' of undefined\r\n\r\nAn error is ONLY thrown if the project includes a custom pipe. There may be other circumstances which cause the runtime error to be thrown, but this is definitely one of them. This can be very misleading that calling navigate works fine, and then adding a custom pipe breaks this. This would lead developers to think that they have created their pipe wrong, or that somehow a custom pipe is breaking their system. Further complicating the matter is the fact that the stack trace doesn't point at the call to router.navigate"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/189704248","html_url":"https://github.com/angular/angular/issues/6443#issuecomment-189704248","issue_url":"https://api.github.com/repos/angular/angular/issues/6443","id":189704248,"user":{"login":"brandonroberts","id":42211,"avatar_url":"https://avatars.githubusercontent.com/u/42211?v=3","gravatar_id":"","url":"https://api.github.com/users/brandonroberts","html_url":"https://github.com/brandonroberts","followers_url":"https://api.github.com/users/brandonroberts/followers","following_url":"https://api.github.com/users/brandonroberts/following{/other_user}","gists_url":"https://api.github.com/users/brandonroberts/gists{/gist_id}","starred_url":"https://api.github.com/users/brandonroberts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandonroberts/subscriptions","organizations_url":"https://api.github.com/users/brandonroberts/orgs","repos_url":"https://api.github.com/users/brandonroberts/repos","events_url":"https://api.github.com/users/brandonroberts/events{/privacy}","received_events_url":"https://api.github.com/users/brandonroberts/received_events","type":"User","site_admin":false},"created_at":"2016-02-27T19:14:29Z","updated_at":"2016-02-27T19:14:29Z","body":"@juristr good. Subclassing the RouterOutlet seems to get real dicey real fast. If your redirecting from the activate method, you should be preventing the activation call also. I've seen the auth0 example and it isn't doing that which may have been your issue."}}