angular2-google-chart icon indicating copy to clipboard operation
angular2-google-chart copied to clipboard

Error: Unexpected value 'GoogleChart' declared by the module

Open MorlaRamakrishna opened this issue 8 years ago • 20 comments

I have imported 'GoogleChart' in Module and added it to declarations array, but still getting this error.

FYI: I am working with es6

MorlaRamakrishna avatar May 16 '17 05:05 MorlaRamakrishna

Hi please ref the below link for the installation process https://github.com/vimalavinisha/angular2-google-chart/issues/25

I will update the readme soon

vimalavinisha avatar May 16 '17 06:05 vimalavinisha

Hi VimalaVinisha,

I have followed the same process to install, but getting the same error.

MorlaRamakrishna avatar May 16 '17 08:05 MorlaRamakrishna

image

MorlaRamakrishna avatar May 16 '17 09:05 MorlaRamakrishna

Did you give the path match in the system.config.js if SystemJS used like var map = { 'angular2-google-chart': 'node_modules/angular2-google-chart'

} var packages = { 'angular2-google-chart': {defaultExtension: 'js'} }

vimalavinisha avatar May 16 '17 09:05 vimalavinisha

I am using web pack (JHipster generated application) it will take care of that

MorlaRamakrishna avatar May 16 '17 10:05 MorlaRamakrishna

Having the same issue, this installation doesn't work well with webpack

ilanle avatar May 26 '17 06:05 ilanle

Same problem.

pawelec avatar May 29 '17 18:05 pawelec

Please check whether you have given the correct npm module path

vimalavinisha avatar May 30 '17 05:05 vimalavinisha

The same issue. Probably, angular2-google-chart is not compatible with angular 4.1.3 I think we can use it only with 4.0.2 Please, can you confirm me, if I'm right? Uncaught Error: Unexpected value 'GoogleChart' declared by the module 'AppModule'. Please add a @Pipe/@Directive/@Component annotation. at syntaxError (http://localhost:4200/vendor.bundle.js:56146:34) [<root>] at http://localhost:4200/vendor.bundle.js:69148:40 [<root>] at Array.forEach (native) [<root>] at CompileMetadataResolver.getNgModuleMetadata (http://localhost:4200/vendor.bundle.js:69130:54) [<root>] at JitCompiler._loadModules (http://localhost:4200/vendor.bundle.js:80236:66) [<root>] at JitCompiler._compileModuleAndComponents (http://localhost:4200/vendor.bundle.js:80195:52) [<root>] at JitCompiler.compileModuleAsync (http://localhost:4200/vendor.bundle.js:80157:23) [<root>] at PlatformRef_._bootstrapModuleWithZone (http://localhost:4200/vendor.bundle.js:5218:25) [<root>] at PlatformRef_.bootstrapModule (http://localhost:4200/vendor.bundle.js:5204:21) [<root>] at Object.342 (http://localhost:4200/main.bundle.js:1211:124) [<root>]

Gicus avatar May 30 '17 21:05 Gicus

Same here. I am using 4.1.3 and I got same error with @Gicus . While I was running npm install I got following warnings.

└─┬ [email protected]
  ├── @angular/[email protected]
  ├── UNMET PEER DEPENDENCY @angular/[email protected]
  ├── UNMET PEER DEPENDENCY @angular/[email protected]
  ├── UNMET PEER DEPENDENCY @angular/[email protected]
  ├── UNMET PEER DEPENDENCY @angular/[email protected]
  ├── @angular/[email protected]
  ├─┬ [email protected]
  │ └── [email protected]
  └── [email protected]

npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none was installed.
npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none was installed.
npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none was installed.
npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none was installed.

wraith7 avatar Jun 01 '17 00:06 wraith7

@wraith7 Did you find a solution?

Gicus avatar Jun 02 '17 09:06 Gicus

@Gicus , @wraith7

Now I updated this package to angualr - 4.1.3 Please take a new version of lib and check Let me know whether this issue has been fixed or not

vimalavinisha avatar Jun 02 '17 10:06 vimalavinisha

@vimalavinisha

I got the last version and it still gives the same error, but I'm using the angular - 4.2.3

command: ng build --aot --progress --verbose image

dependencies: image

lucasvrocha avatar Jun 20 '17 00:06 lucasvrocha

Same problem here... It was working previously and then I cloned my repo with this code again and now it doesn't work...

ccdle12 avatar Jun 20 '17 17:06 ccdle12

I solved this problem by setting the path in the tsconfig.json file that is used by angular-cli

image

You can see the fix here angular/angular-cli#4647 (comment)

lucasvrocha avatar Jun 21 '17 00:06 lucasvrocha

@lvr123321

Thanks, this solution worked for me

ccdle12 avatar Jun 21 '17 10:06 ccdle12

The error comes everytime there is a mismatch between angular's version (@4.2.4) and angular2-google-chart's version.. Please update the package.json as in #43

manish7singh avatar Jun 29 '17 05:06 manish7singh

same here ,i'm using angular version 4.1.3 but still getting Uncaught Error: Unexpected value 'GoogleChart' declared by the module 'AppModule'. Please add a @Pipe/@Directive/@Component annotation. Error

sagarthecook avatar Aug 07 '17 07:08 sagarthecook

I'm using version 4.3.2 some error.

maliaga avatar Nov 06 '17 18:11 maliaga

I solved this problem by setting the path in the tsconfig.json file that is used by angular-cli

image

You can see the fix here angular/angular-cli#4647 (comment)

This solve my problem too, I was using Angular 4.4.3, and I tried alot of things

    "paths": {   
      "@angular/common": ["../node_modules/@angular/common"],
      "@angular/compiler": ["../node_modules/@angular/compiler"],
      "@angular/core": ["../node_modules/@angular/core"],
      "@angular/forms": ["../node_modules/@angular/forms"],
      "@angular/router": ["../node_modules/@angular/router"],
      "@angular/platform-browser": ["../node_modules/@angular/platform-browser"],
      "@angular/platform-browser-dynamic": ["../node_modules/@angular/platform-browser-dynamic"],
      "@angular/http": ["../node_modules/@angular/http"]
    }

do not leave any trailing comma

larcheryjung avatar Mar 24 '21 09:03 larcheryjung