Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Directive annotation exception #1

Closed
leejw74 opened this issue Aug 10, 2016 · 7 comments
Closed

No Directive annotation exception #1

leejw74 opened this issue Aug 10, 2016 · 7 comments

Comments

@leejw74
Copy link

leejw74 commented Aug 10, 2016

Hi.
As per usage procedure, it occurred following error.

5 881004 group EXCEPTION: Error in ./ModalCmp class ModalCmp_Host - inline template:0:0
7 881005 error ORIGINAL EXCEPTION: No Directive annotation found on CalendarComponent
6 881004 error EXCEPTION: Error in ./ModalCmp class ModalCmp_Host - inline template:0:0
8 881005 error ORIGINAL STACKTRACE:
9 881006 error Error: No Directive annotation found on CalendarComponent
at new BaseException (http://localhost:8100/build/js/app.bundle.js:4785:23)
at DirectiveResolver.resolve (http://localhost:8100/build/js/app.bundle.js:12072:15)
at CompileMetadataResolver.getDirectiveMetadata (http://localhost:8100/build/js/app.bundle.js:16978:51)
at http://localhost:8100/build/js/app.bundle.js:17100:62
at Array.map (native)
at CompileMetadataResolver.getViewDirectivesMetadata (http://localhost:8100/build/js/app.bundle.js:17100:27)
at RuntimeCompiler._getCompiledTemplate (http://localhost:8100/build/js/app.bundle.js:21087:36)
at RuntimeCompiler._getTransitiveCompiledTemplates (http://localhost:8100/build/js/app.bundle.js:21105:80)
at http://localhost:8100/build/js/app.bundle.js:21108:77
at Array.forEach (native)
10 881006 error ERROR CONTEXT:

What is a problem?

Thanks in advance.

@twinssbc
Copy link
Owner

@leejw74 May I know which version of the Ionic and Angular are you using?
And how do you use the CalendarComponent in your component class?

@leejw74
Copy link
Author

leejw74 commented Aug 11, 2016

I'm using following.
"dependencies": {
"@angular/common": "^2.0.0-rc.3",
"@angular/compiler": "^2.0.0-rc.3",
"@angular/core": "^2.0.0-rc.3",
"@angular/http": "^2.0.0-rc.3",
"@angular/platform-browser": "^2.0.0-rc.3",
"@angular/platform-browser-dynamic": "^2.0.0-rc.3",
"@angular/router": "^2.0.0-rc.2",
"es6-shim": "0.35.1",
"ionic-angular": "^2.0.0-beta.10",
"ionic-native": "^1.3.10",
"ionic2-calendar": "^0.0.2",
"ionicons": "3.0.0",
"reflect-metadata": "0.1.8",
"rxjs": "5.0.0-beta.11",
"zone.js": "0.6.12"
}

I tested two, the first is source in demo(home.ts, home.html), the other is my.ts and my.html.
both is same.

@twinssbc
Copy link
Owner

@leejw74 Could you provide the snippet that using the CalendarComponent in your ts file?

@twinssbc
Copy link
Owner

I can reproduce the issue, will take a look.

@leejw74
Copy link
Author

leejw74 commented Aug 12, 2016

I sent email to you.

@twinssbc
Copy link
Owner

@leejw74 I may found the root cause.
The package.json in this calendar component contains dependency as below.

  "dependencies": {
    "@angular/common": "2.0.0-rc.3",
    "@angular/compiler": "2.0.0-rc.3",
    "@angular/core": "2.0.0-rc.3",
    "@angular/platform-browser": "2.0.0-rc.3",
    "@angular/platform-browser-dynamic": "2.0.0-rc.3",
    "@angular/http": "2.0.0-rc.3",
    "es6-shim": "^0.35.0",
    "reflect-metadata": "^0.1.3",
    "ionic-angular": "2.0.0-beta.10",
    "rxjs": "5.0.0-beta.6",
    "zone.js": "~0.6.12"
  }

Note that they are mainly referencing to a specific version.
But the current angular version is 2.0.0-rc.4, so the 2.0.0-rc.3 dependencies will be installed in the node_modules directory inside of the component install directory.
If I remove that node_modules directory, the calendar is working.
I guess referencing two version of angular may cause some break.

I will modify the package.json to remove these dependencies.

@twinssbc
Copy link
Owner

@leejw74 I think I have fixed it. You can try the latest version, 0.0.3. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants