<p dir="auto">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:</p>
<p dir="auto">TypeError: Cannot read property 'constructor' of undefined</p>
<p dir="auto">An 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</p>
<p dir="auto">When using a custom pipe inside of an <code class="notranslate">ng-switch-default</code>  the pipe breaks with the exception:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="EXCEPTION: TypeError: Cannot read property 'constructor' of undefined in [null]

TypeError: Cannot read property 'constructor' of undefined
    at Object.implementsOnDestroy (https://code.angularjs.org/2.0.0-alpha.45/angular2.dev.js:7655:16)
    at Function.ChangeDetectionUtil.callPipeOnDestroy (https://code.angularjs.org/2.0.0-alpha.45/angular2.dev.js:16480:38)
    at AbstractChangeDetector.ChangeDetector_Hello_5.dehydrateDirectives (eval at &lt;anonymous&gt; (https://code.angularjs.org/2.0.0-alpha.45/angular2.dev.js:20571:14), &lt;anonymous&gt;:93:49)
    at AbstractChangeDetector.dehydrate (https://code.angularjs.org/2.0.0-alpha.45/angular2.dev.js:20384:12)
    at AppViewManagerUtils.dehydrateView (https://code.angularjs.org/2.0.0-alpha.45/angular2.dev.js:17481:35)
    at AppViewManager_._viewDehydrateRecurse (https://code.angularjs.org/2.0.0-alpha.45/angular2.dev.js:21117:21)
    at AppViewManager_._destroyViewInContainer (https://code.angularjs.org/2.0.0-alpha.45/angular2.dev.js:21105:12)
    at AppViewManager_.destroyViewInContainer (https://code.angularjs.org/2.0.0-alpha.45/angular2.dev.js:21060:12)
    at ViewContainerRef_.remove (https://code.angularjs.org/2.0.0-alpha.45/angular2.dev.js:9707:24)
    at ViewContainerRef_.ViewContainerRef.clear (https://code.angularjs.org/2.0.0-alpha.45/angular2.dev.js:9632:14)BrowserDomAdapter.logError @ angular2.dev.js:21984ExceptionHandler.call @ angular2.dev.js:4439(anonymous function) @ angular2.dev.js:19685NgZone._notifyOnError @ angular2.dev.js:10746errorHandling.onError @ angular2.dev.js:10654run @ angular2.dev.js:141(anonymous function) @ angular2.dev.js:10678zoneBoundFn @ angular2.dev.js:111lib$es6$promise$asap$$flush @ angular2.dev.js:1301
2015-11-06 15:24:17.011 angular2.dev.js:21984 ERROR CONTEXT:BrowserDomAdapter.logError @ angular2.dev.js:21984ExceptionHandler.call @ angular2.dev.js:4442(anonymous function) @ angular2.dev.js:19685NgZone._notifyOnError @ angular2.dev.js:10746errorHandling.onError @ angular2.dev.js:10654run @ angular2.dev.js:141(anonymous function) @ angular2.dev.js:10678zoneBoundFn @ angular2.dev.js:111lib$es6$promise$asap$$flush @ angular2.dev.js:1301
"><pre class="notranslate"><code class="notranslate">EXCEPTION: TypeError: Cannot read property 'constructor' of undefined in [null]

TypeError: Cannot read property 'constructor' of undefined
    at Object.implementsOnDestroy (https://code.angularjs.org/2.0.0-alpha.45/angular2.dev.js:7655:16)
    at Function.ChangeDetectionUtil.callPipeOnDestroy (https://code.angularjs.org/2.0.0-alpha.45/angular2.dev.js:16480:38)
    at AbstractChangeDetector.ChangeDetector_Hello_5.dehydrateDirectives (eval at &lt;anonymous&gt; (https://code.angularjs.org/2.0.0-alpha.45/angular2.dev.js:20571:14), &lt;anonymous&gt;:93:49)
    at AbstractChangeDetector.dehydrate (https://code.angularjs.org/2.0.0-alpha.45/angular2.dev.js:20384:12)
    at AppViewManagerUtils.dehydrateView (https://code.angularjs.org/2.0.0-alpha.45/angular2.dev.js:17481:35)
    at AppViewManager_._viewDehydrateRecurse (https://code.angularjs.org/2.0.0-alpha.45/angular2.dev.js:21117:21)
    at AppViewManager_._destroyViewInContainer (https://code.angularjs.org/2.0.0-alpha.45/angular2.dev.js:21105:12)
    at AppViewManager_.destroyViewInContainer (https://code.angularjs.org/2.0.0-alpha.45/angular2.dev.js:21060:12)
    at ViewContainerRef_.remove (https://code.angularjs.org/2.0.0-alpha.45/angular2.dev.js:9707:24)
    at ViewContainerRef_.ViewContainerRef.clear (https://code.angularjs.org/2.0.0-alpha.45/angular2.dev.js:9632:14)BrowserDomAdapter.logError @ angular2.dev.js:21984ExceptionHandler.call @ angular2.dev.js:4439(anonymous function) @ angular2.dev.js:19685NgZone._notifyOnError @ angular2.dev.js:10746errorHandling.onError @ angular2.dev.js:10654run @ angular2.dev.js:141(anonymous function) @ angular2.dev.js:10678zoneBoundFn @ angular2.dev.js:111lib$es6$promise$asap$$flush @ angular2.dev.js:1301
2015-11-06 15:24:17.011 angular2.dev.js:21984 ERROR CONTEXT:BrowserDomAdapter.logError @ angular2.dev.js:21984ExceptionHandler.call @ angular2.dev.js:4442(anonymous function) @ angular2.dev.js:19685NgZone._notifyOnError @ angular2.dev.js:10746errorHandling.onError @ angular2.dev.js:10654run @ angular2.dev.js:141(anonymous function) @ angular2.dev.js:10678zoneBoundFn @ angular2.dev.js:111lib$es6$promise$asap$$flush @ angular2.dev.js:1301

</code></pre></div>
<p dir="auto">Here is a plunker:  <a href="http://plnkr.co/edit/PSRVVPtbl6MzRzNPzc2b?p=preview" rel="nofollow">http://plnkr.co/edit/PSRVVPtbl6MzRzNPzc2b?p=preview</a><br>
When I remove the <code class="notranslate">ng-switch-default</code> template, I don't get the error.</p>
<p dir="auto">Using Chrome 46 on Mac.</p>