title: Angular2 - The selector "my-app" did not match any elements (only on first load)
body: <p>Does anyone know why I get this error when the page loads the first time in my Angular2 app?  It clears away and doesn't come back as I navigate through my app.  If I hit CTRL+F5 it tends to come back (though not every single time!). This routing for this app looks like this:</p>
  
  <pre><code>AppComponent.ts
    LoginComponent.ts
    DashboardComponent(Parent route with its own child routes)
      MainDashboardComponent
      EmployeesComponent
  </code></pre>
  
  <p>The top level index.html file has the <code>&lt;my-app&gt;&lt;/my-app&gt;</code> tag in it that the error complains about periodically so I'm confused how it could be that it wouldn't see that tag on the page!</p>
  
  <p>Error Details:</p>
  
  <blockquote>
    <p>EXCEPTION: The selector "my-app" did not match any elementsBrowserDomAdapter.logError @ angular2.dev.js:22823BrowserDomAdapter.logGroup @ angular2.dev.js:22834ExceptionHandler.call @ angular2.dev.js:1163(anonymous function) @ angular2.dev.js:12481NgZone._notifyOnError @ angular2.dev.js:13405collection_1.StringMapWrapper.merge.onError @ angular2.dev.js:13309run @ angular2-polyfills.js:141(anonymous function) @ angular2.dev.js:13328zoneBoundFn @ angular2-polyfills.js:111lib$es6$promise$$internal$$tryCatch @ angular2-polyfills.js:1511lib$es6$promise$$internal$$invokeCallback @ angular2-polyfills.js:1523lib$es6$promise$$internal$$publish @ angular2-polyfills.js:1494(anonymous function) @ angular2-polyfills.js:243microtask @ angular2.dev.js:13360run @ angular2-polyfills.js:138(anonymous function) @ angular2.dev.js:13328zoneBoundFn @ angular2-polyfills.js:111lib$es6$promise$asap$$flush @ angular2-polyfills.js:1305
    angular2.dev.js:22823 STACKTRACE:BrowserDomAdapter.logError @ angular2.dev.js:22823ExceptionHandler.call @ angular2.dev.js:1165(anonymous function) @ angular2.dev.js:12481NgZone._notifyOnError @ angular2.dev.js:13405collection_1.StringMapWrapper.merge.onError @ angular2.dev.js:13309run @ angular2-polyfills.js:141(anonymous function) @ angular2.dev.js:13328zoneBoundFn @ angular2-polyfills.js:111lib$es6$promise$$internal$$tryCatch @ angular2-polyfills.js:1511lib$es6$promise$$internal$$invokeCallback @ angular2-polyfills.js:1523lib$es6$promise$$internal$$publish @ angular2-polyfills.js:1494(anonymous function) @ angular2-polyfills.js:243microtask @ angular2.dev.js:13360run @ angular2-polyfills.js:138(anonymous function) @ angular2.dev.js:13328zoneBoundFn @ angular2-polyfills.js:111lib$es6$promise$asap$$flush @ angular2-polyfills.js:1305
    angular2.dev.js:22823 Error: The selector "my-app" did not match any elements
        at new BaseException (<a href="http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:7104:21" rel="nofollow">http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:7104:21</a>)
        at DomRenderer.selectRootElement (<a href="http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:13724:15" rel="nofollow">http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:13724:15</a>)
        at HostViewFactory.viewFactory_HostAppComponent0 [as viewFactory] (viewFactory_HostAppComponent:72:18)
        at AppViewManager_.createRootHostView (<a href="http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:9226:34" rel="nofollow">http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:9226:34</a>)
        at <a href="http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:12246:46" rel="nofollow">http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:12246:46</a>
        at Zone.run (<a href="http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:138:17" rel="nofollow">http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:138:17</a>)
        at Zone.run (<a href="http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:13328:32" rel="nofollow">http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:13328:32</a>)
        at zoneBoundFn (<a href="http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:111:19" rel="nofollow">http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:111:19</a>)
        at lib$es6$promise$$internal$$tryCatch (<a href="http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:1511:16" rel="nofollow">http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:1511:16</a>)
        at lib$es6$promise$$internal$$invokeCallback (<a href="http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:1523:17" rel="nofollow">http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:1523:17</a>)</p>
    
    <p>-----async gap-----
    Error
        at _getStacktraceWithUncaughtError (<a href="http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:2195:26" rel="nofollow">http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:2195:26</a>)
        at Zone.fork (<a href="http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:2253:40" rel="nofollow">http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:2253:40</a>)
        at Zone.bind (<a href="http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:109:48" rel="nofollow">http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:109:48</a>)
        at bindArguments (<a href="http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:980:29" rel="nofollow">http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:980:29</a>)
        at lib$es6$promise$promise$$Promise.obj.(anonymous function) [as then] (<a href="http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:1000:37" rel="nofollow">http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:1000:37</a>)
        at DynamicComponentLoader_.loadAsRoot (<a href="http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:12245:49" rel="nofollow">http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:12245:49</a>)
        at di_1.provide.useFactory (<a href="http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:12343:39" rel="nofollow">http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:12343:39</a>)
        at Injector._instantiate (<a href="http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:11354:19" rel="nofollow">http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:11354:19</a>)
        at Injector._instantiateProvider (<a href="http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:11287:21" rel="nofollow">http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:11287:21</a>)
        at Injector._new (<a href="http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:11277:19" rel="nofollow">http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:11277:19</a>)</p>
    
    <p>-----async gap-----
    Error
        at _getStacktraceWithUncaughtError (<a href="http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:2195:26" rel="nofollow">http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:2195:26</a>)
        at Zone.fork (<a href="http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:2253:40" rel="nofollow">http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:2253:40</a>)
        at NgZone._createInnerZone (<a href="http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:13316:39" rel="nofollow">http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:13316:39</a>)
        at new NgZone (<a href="http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:13182:32" rel="nofollow">http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:13182:32</a>)
        at createNgZone (<a href="http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:12365:12" rel="nofollow">http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:12365:12</a>)
        at PlatformRef_.application (<a href="http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:12440:31" rel="nofollow">http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:12440:31</a>)
        at Object.bootstrap (<a href="http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:24543:64" rel="nofollow">http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:24543:64</a>)
        at execute (<a href="http://localhost:3000/app/main.js:15:23" rel="nofollow">http://localhost:3000/app/main.js:15:23</a>)
        at ensureEvaluated (<a href="http://localhost:3000/node_modules/systemjs/dist/system.src.js:3202:26" rel="nofollow">http://localhost:3000/node_modules/systemjs/dist/system.src.js:3202:26</a>)
        at Object.execute (<a href="http://localhost:3000/node_modules/systemjs/dist/system.src.js:3323:13)BrowserDomAdapter.logError" rel="nofollow">http://localhost:3000/node_modules/systemjs/dist/system.src.js:3323:13)BrowserDomAdapter.logError</a> @ angular2.dev.js:22823ExceptionHandler.call @ angular2.dev.js:1166(anonymous function) @ angular2.dev.js:12481NgZone._notifyOnError @ angular2.dev.js:13405collection_1.StringMapWrapper.merge.onError @ angular2.dev.js:13309run @ angular2-polyfills.js:141(anonymous function) @ angular2.dev.js:13328zoneBoundFn @ angular2-polyfills.js:111lib$es6$promise$$internal$$tryCatch @ angular2-polyfills.js:1511lib$es6$promise$$internal$$invokeCallback @ angular2-polyfills.js:1523lib$es6$promise$$internal$$publish @ angular2-polyfills.js:1494(anonymous function) @ angular2-polyfills.js:243microtask @ angular2.dev.js:13360run @ angular2-polyfills.js:138(anonymous function) @ angular2.dev.js:13328zoneBoundFn @ angular2-polyfills.js:111lib$es6$promise$asap$$flush @ angular2-polyfills.js:1305</p>
  </blockquote>