Teddy
Teddy

Reputation: 2347

Angular 2 RC1 "No Directive annotation found" after upgrade

I get this error, I cant figure out what is wrong, the code is the same and worked in Angular 2 Beta 17. I did all properly, I checked on Angular2 site couple of times.

ERROR

EXCEPTION: No Directive annotation found on AWebAppComponent
browser_adapter.ts:78EXCEPTION: No Directive annotation found on AWebAppComponentBrowserDomAdapter.logError @ browser_adapter.ts:78BrowserDomAdapter.logGroup @ browser_adapter.ts:89ExceptionHandler.call @ exception_handler.ts:53(anonymous function) @ application_ref.ts:345ZoneDelegate.invoke @ angular2-polyfills.js:349NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.ts:67ZoneDelegate.invoke @ angular2-polyfills.js:348Zone.run @ angular2-polyfills.js:242NgZoneImpl.runInner @ ng_zone_impl.ts:99NgZone.run @ ng_zone.ts:210ApplicationRef_.run @ application_ref.ts:335coreLoadAndBootstrap @ application_ref.ts:101bootstrap @ platform_browser_dynamic.ts:105execute @ init.ts:15ensureEvaluated @ system.src.js:3317execute @ system.src.js:3435doDynamicExecute @ system.src.js:798link @ system.src.js:1000doLink @ system.src.js:652updateLinkSetOnLoad @ system.src.js:700(anonymous function) @ system.src.js:512ZoneDelegate.invoke @ angular2-polyfills.js:349Zone.run @ angular2-polyfills.js:242(anonymous function) @ angular2-polyfills.js:597ZoneDelegate.invokeTask @ angular2-polyfills.js:382Zone.runTask @ angular2-polyfills.js:282drainMicroTaskQueue @ angular2-polyfills.js:500ZoneTask.invoke @ angular2-polyfills.js:452
browser_adapter.ts:78STACKTRACE:BrowserDomAdapter.logError @ browser_adapter.ts:78ExceptionHandler.call @ exception_handler.ts:56(anonymous function) @ application_ref.ts:345ZoneDelegate.invoke @ angular2-polyfills.js:349NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.ts:67ZoneDelegate.invoke @ angular2-polyfills.js:348Zone.run @ angular2-polyfills.js:242NgZoneImpl.runInner @ ng_zone_impl.ts:99NgZone.run @ ng_zone.ts:210ApplicationRef_.run @ application_ref.ts:335coreLoadAndBootstrap @ application_ref.ts:101bootstrap @ platform_browser_dynamic.ts:105execute @ init.ts:15ensureEvaluated @ system.src.js:3317execute @ system.src.js:3435doDynamicExecute @ system.src.js:798link @ system.src.js:1000doLink @ system.src.js:652updateLinkSetOnLoad @ system.src.js:700(anonymous function) @ system.src.js:512ZoneDelegate.invoke @ angular2-polyfills.js:349Zone.run @ angular2-polyfills.js:242(anonymous function) @ angular2-polyfills.js:597ZoneDelegate.invokeTask @ angular2-polyfills.js:382Zone.runTask @ angular2-polyfills.js:282drainMicroTaskQueue @ angular2-polyfills.js:500ZoneTask.invoke @ angular2-polyfills.js:452
browser_adapter.ts:78Error: No Directive annotation found on AWebAppComponent
    at new BaseException (exceptions.ts:14)
    at DirectiveResolver.resolve (directive_resolver.ts:54)
    at CompileMetadataResolver.getDirectiveMetadata (metadata_resolver.ts:82)
    at RuntimeCompiler.resolveComponent (runtime_compiler.ts:51)
    at eval (application_ref.ts:104)
    at eval (application_ref.ts:337)
    at ZoneDelegate.invoke (angular2-polyfills.js:349)
    at Object.NgZoneImpl.inner.inner.fork.onInvoke (ng_zone_impl.ts:67)
    at ZoneDelegate.invoke (angular2-polyfills.js:348)
    at Zone.run (angular2-polyfills.js:242)BrowserDomAdapter.logError @ browser_adapter.ts:78ExceptionHandler.call @ exception_handler.ts:57(anonymous function) @ application_ref.ts:345ZoneDelegate.invoke @ angular2-polyfills.js:349NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.ts:67ZoneDelegate.invoke @ angular2-polyfills.js:348Zone.run @ angular2-polyfills.js:242NgZoneImpl.runInner @ ng_zone_impl.ts:99NgZone.run @ ng_zone.ts:210ApplicationRef_.run @ application_ref.ts:335coreLoadAndBootstrap @ application_ref.ts:101bootstrap @ platform_browser_dynamic.ts:105execute @ init.ts:15ensureEvaluated @ system.src.js:3317execute @ system.src.js:3435doDynamicExecute @ system.src.js:798link @ system.src.js:1000doLink @ system.src.js:652updateLinkSetOnLoad @ system.src.js:700(anonymous function) @ system.src.js:512ZoneDelegate.invoke @ angular2-polyfills.js:349Zone.run @ angular2-polyfills.js:242(anonymous function) @ angular2-polyfills.js:597ZoneDelegate.invokeTask @ angular2-polyfills.js:382Zone.runTask @ angular2-polyfills.js:282drainMicroTaskQueue @ angular2-polyfills.js:500ZoneTask.invoke @ angular2-polyfills.js:452
angular2-polyfills.js:349 Error: Error: No Directive annotation found on AWebAppComponent(…)

Upvotes: 1

Views: 282

Answers (1)

Teddy
Teddy

Reputation: 2347

The problem was that I did not replace all import statements.

This error occurs when import is not good.

I corrected imports and all working now.

Upvotes: 1

Related Questions