Strangest error ever. Unreachable code causes exception


#1
    isAnalysisComplete() {
    return true;
    //don't know why this is required but it will crash without the following line
//    this.nav.setRoot(Messages);
}

EXCEPTION: Unexpected directive value ‘undefined’ on the View of component 'Messages’
browser_adapter.ts:73 EXCEPTION: Unexpected directive value ‘undefined’ on the View of component 'Messages’BrowserDomAdapter.logError @ browser_adapter.ts:73BrowserDomAdapter.logGroup @ browser_adapter.ts:84ExceptionHandler.call @ exception_handler.ts:49(anonymous function) @ application_ref.ts:262NgZone._notifyOnError @ ng_zone.ts:454collection_1.StringMapWrapper.merge.onError @ ng_zone.ts:353Zone.run @ angular2-polyfills.js:1247(anonymous function) @ ng_zone.ts:371zoneBoundFn @ angular2-polyfills.js:1220lib$es6$promise$$internal$$tryCatch @ angular2-polyfills.js:468lib$es6$promise$$internal$$invokeCallback @ angular2-polyfills.js:480lib$es6$promise$$internal$$publish @ angular2-polyfills.js:451(anonymous function) @ angular2-polyfills.js:123microtask @ ng_zone.ts:410Zone.run @ angular2-polyfills.js:1243(anonymous function) @ ng_zone.ts:371zoneBoundFn @ angular2-polyfills.js:1220lib$es6$promise$asap$$flush @ angular2-polyfills.js:262
browser_adapter.ts:73 STACKTRACE:BrowserDomAdapter.logError @ browser_adapter.ts:73ExceptionHandler.call @ exception_handler.ts:52(anonymous function) @ application_ref.ts:262NgZone._notifyOnError @ ng_zone.ts:454collection_1.StringMapWrapper.merge.onError @ ng_zone.ts:353Zone.run @ angular2-polyfills.js:1247(anonymous function) @ ng_zone.ts:371zoneBoundFn @ angular2-polyfills.js:1220lib$es6$promise$$internal$$tryCatch @ angular2-polyfills.js:468lib$es6$promise$$internal$$invokeCallback @ angular2-polyfills.js:480lib$es6$promise$$internal$$publish @ angular2-polyfills.js:451(anonymous function) @ angular2-polyfills.js:123microtask @ ng_zone.ts:410Zone.run @ angular2-polyfills.js:1243(anonymous function) @ ng_zone.ts:371zoneBoundFn @ angular2-polyfills.js:1220lib$es6$promise$asap$$flush @ angular2-polyfills.js:262
browser_adapter.ts:73 Error: Unexpected directive value ‘undefined’ on the View of component 'Messages’
at new BaseException (http://localhost:8100/build/js/app.bundle.js:27733:23)
at RuntimeMetadataResolver.getViewDirectivesMetadata (http://localhost:8100/build/js/app.bundle.js:8511:23)
at TemplateCompiler._compileNestedComponentRuntime (http://localhost:8100/build/js/app.bundle.js:10106:65)
at http://localhost:8100/build/js/app.bundle.js:10091:87
at Array.forEach (native)
at http://localhost:8100/build/js/app.bundle.js:10091:43
at Zone.run (http://localhost:8100/build/js/angular2-polyfills.js:1243:24)
at Zone.run (http://localhost:8100/build/js/app.bundle.js:26986:42)
at zoneBoundFn (http://localhost:8100/build/js/angular2-polyfills.js:1220:26)
at lib$es6$promise$$internal$$tryCatch (http://localhost:8100/build/js/angular2-polyfills.js:468:17)

-----async gap-----
Error
at _getStacktraceWithUncaughtError (http://localhost:8100/build/js/angular2-polyfills.js:2236:29)
at Zone.fork (http://localhost:8100/build/js/angular2-polyfills.js:2285:47)
at Zone.bind (http://localhost:8100/build/js/angular2-polyfills.js:1218:53)
at bindArguments (http://localhost:8100/build/js/angular2-polyfills.js:1401:36)
at lib$es6$promise$promise$$Promise.obj.(anonymous function) [as then] (http://localhost:8100/build/js/angular2-polyfills.js:1413:46)
at TemplateCompiler.compileComponentRuntime (http://localhost:8100/build/js/app.bundle.js:10085:18)
at TemplateCompiler.compileHostComponentRuntime (http://localhost:8100/build/js/app.bundle.js:10036:18)
at RuntimeCompiler
.compileInHost (http://localhost:8100/build/js/app.bundle.js:8402:39)
at NavController.loadPage (http://localhost:8100/build/js/app.bundle.js:42526:42)
at NavController._render (http://localhost:8100/build/js/app.bundle.js:42221:18)

-----async gap-----
Error
at _getStacktraceWithUncaughtError (http://localhost:8100/build/js/angular2-polyfills.js:2236:29)
at Zone.fork (http://localhost:8100/build/js/angular2-polyfills.js:2285:47)
at NgZone.createInnerZone (http://localhost:8100/build/js/app.bundle.js:26974:14)
at new NgZone (http://localhost:8100/build/js/app.bundle.js:26759:36)
at createNgZone (http://localhost:8100/build/js/app.bundle.js:12213:12)
at PlatformRef
.application (http://localhost:8100/build/js/app.bundle.js:12314:33)
at Object.bootstrap (http://localhost:8100/build/js/app.bundle.js:1471:64)
at http://localhost:8100/build/js/app.bundle.js:53695:19
at DecorateConstructor (http://localhost:8100/build/js/angular2-polyfills.js:2890:29)
at Object.decorate (http://localhost:8100/build/js/angular2-polyfills.js:2452:20)


#2

Without seeing more of the code it’s hard to say - according to Google it might be caused by using outdated code or by a circular TypeScript import dependency: