crisbeto / angular-svg-round-progressbar

Angular module that uses SVG to create a circular progressbar
https://crisbeto.github.io/angular-svg-round-progressbar/
MIT License
741 stars 173 forks source link

when I upgrade to version 1.2.0 , i have the problem : "Uncaught Error: Unexpected value 'RoundProgressModule' imported by the module 'SharedModule'. Please add a @NgModule annotation." . How to fix ? #143

Closed jerry7411 closed 6 years ago

jerry7411 commented 6 years ago

I upgrade my angular verion 4.4.6 to 5.0.0 and upgrade angular-svg-round-progressbar version 1.1.1 to 1.2.0 then i have the problem : ": "Uncaught Error: Unexpected value 'RoundProgressModule' imported by the module 'SharedModule'. Please add a @NgModule annotation." . How to fix ?

CarlosTorrecillas commented 6 years ago

Looks like is the same as https://github.com/crisbeto/angular-svg-round-progressbar/issues/142

papaiatis commented 6 years ago

I have the same problem here. This is blocking me from upgrading my project to Angular 5.

maku commented 6 years ago

Same here

crisbeto commented 6 years ago

The demo is set up using Angular 5 and it seems to work. How are you compiling your app? AFAIK as of Angular 5 you should use the @angular/compiler-cli.

CarlosTorrecillas commented 6 years ago

My tsconfig.app.json:

{ "extends": "../tsconfig.json", "compilerOptions": { "outDir": "../out-tsc/app", "baseUrl": "./", "module": "es2015", "types": ["node"] }, "exclude": [ "test.ts", "*/.spec.ts" ] }

My tsconfig.json: { "compileOnSave": false, "compilerOptions": { "outDir": "./dist/out-tsc", "sourceMap": true, "declaration": false, "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, "target": "es5", "typeRoots": [ "node_modules/@types" ], "lib": [ "es2017", "dom" ] } }

The only thing I took from v5.0.0 is the preserve white spaces option = false which I added to the configuration

maku commented 6 years ago

@crisbeto I made a fresh project with angular-cli (1.5) and I tried also stackblitz.com (https://stackblitz.com/edit/angular-cxhpto) with the simplest possible test.

In both cases I got

Error: Unexpected value 'RoundProgressModule' imported by the module 'AppModule'. Please add a @NgModule annotation.
kfrijters commented 6 years ago

I had the same problem, for me the solution was just copying the src folder into my application instead of loading it from yarn. I did remove the tsconfig from the source file, don't know if that matters.

I think that there is a problem with the tsconfig settings for distributing as a package because the src works.

ianlintner-wf commented 6 years ago

npm install angular-svg-round-progressbar@1.1.0 --save

mdybich commented 6 years ago

Same problem here

ghbob commented 6 years ago

So, I looked around and found this: https://stackoverflow.com/questions/45468663

Once i removed the node_modules/angular-svg-round-progressbar/node_modules directory both ng serve and ng build worked again. (Angular 5.0.0, progressbar 1.1.1)

sharok commented 6 years ago

The same error, I migrated my project to Angular 5.0.3 and updated the lib to 1.2.0. Did clean npm install. Didn't help.

crisbeto commented 6 years ago

Should be fixed in the 1.2.1 release. Let me know if it still doesn't work and I'll reopen the issue.