title: Angular2 Router v3, navigate to different level: TypeError: Cannot read property '_routeConfig' of null
body: <p>I'm using new Router v3.0.0-alpha.3. Imagine my routes looks like:</p>
  
  <pre><code>                              App
                                /\
                               /  \
                         Settings  Main
                            / \        
                           /   \      
                         User  Account
  </code></pre>
  
  <p>From the view of User component I would like to navigate to Main component. If I navigate to any component within the Settings level it works fine, but when I try to navigate to other level I get an error:</p>
  
  <pre><code>EXCEPTION: Error: Uncaught (in promise): TypeError: Cannot read property '_routeConfig' of null
  </code></pre>
  
  <p>I naviagate using routerLink directive:</p>
  
  <pre><code>[routerLink]="['/main']"           &lt;- doesn't work
  [routerLink]="['/settings']"       &lt;- works
  [routerLink]="['/settings/user']"  &lt;- works
  </code></pre>
  
  <p>This seems like a global issue. I can only navigate within this same level. Any Idea how I can bypass it? </p>
  
  <p>My routes passed to bootstrap:</p>
  
  <pre><code>export const routes: RouterConfig = [
      ...MainRoutes,
      ...SettingsRoutes
  ];
  
  export const APP_ROUTER_PROVIDERS = [
      provideRouter(routes)
  ];
  </code></pre>
  
  <p><strong>main.routes.ts:</strong></p>
  
  <pre><code>export const MainRoutes: RouterConfig = [{
      path: '/main',
      component: SettingsComponent
  }];
  </code></pre>
  
  <p><strong>settings.routes.ts:</strong></p>
  
  <pre><code>export const SettingsRoutes: RouterConfig = [{
      path: '/settings',
      component: SettingsComponent,
      children: [{
          path: '/user',
          component: UserSettingsComponent,
          index: true
      }]
  }];
  </code></pre>
  
  <p><strong>Edit:</strong></p>
  
  <p>As given link in comments doesn't work anymore I will suggest the temporary fix. The bug still exists in alpha.7 version of router but is going to be fixed <a href="https://github.com/angular/vladivostok/commit/9d6819b39e2b7952bc724c7531c4f53182af5e95" rel="noreferrer">here</a></p>
  
  <p>The problem is in <strong>router.js</strong> file, function <strong>GuardChecks.prototype.runCanDeactivate</strong> line 309 (in router v.alpha.7):</p>
  
  <pre><code>var canDeactivate = curr._routeConfig ? curr._routeConfig.canDeactivate : null;
  </code></pre>
  
  <p>change it to:</p>
  
  <pre><code>var canDeactivate = curr &amp;&amp; curr._routeConfig ? curr._routeConfig.canDeactivate : null;
  </code></pre>
  
  <p>Please remember that this should be treated as temporary fix, not suitable for automated production environment!</p>