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
742 stars 173 forks source link

Unexpected value 'undefined' imported by the module 'AppModule' #128

Closed epot closed 7 years ago

epot commented 7 years ago

Hello,

I am trying to follow the readme steps (I am using SystemJS as module loader) but I got this error when importing the RoundProgressModule:

import { RoundProgressModule } from 'angular-svg-round-progressbar';

I do not really know how to debug what is happening. I depend on Angular 4.1.2.

Any idea?

crisbeto commented 7 years ago

That error usually happens if it didn't manage to find the class that you're importing (even though it loaded the file).

epot commented 7 years ago

Ok. I did import the UMD file, I wonder how the class cannot be found afterwards.

crisbeto commented 7 years ago

I think the UMD file might not work correctly at the moment (I'll have to spend a bit more time on the build process to get it working). Can you try using the index file instead?

epot commented 7 years ago

Do you mean putting this:

'angular-svg-round-progressbar': 'npm:angular-svg-round-progressbar/dist/index.js',

in my systemjs.config.js file? Cause I then get 404 errors for others angular-svg-round-progressbar files (like round-progress.config). Sorry I am a newbie in all those things (angular2, systemJS...), I was hoping it would work out of the box :-).

crisbeto commented 7 years ago

Yes, pointing it to the index.js should do it.

epot commented 7 years ago

Unfortunately I am getting several 404:

Failed to load resource: the server responded with a status of 404 () localhost/:22 Error: Fetch error: 404 Instantiating https://localhost/libs/angular-svg-round-progressbar/dist/round-progress.config

The files have the js extensions, but it seems to be looking for a file without the extension.

crisbeto commented 7 years ago

Hmm, weird thing about that URL is that it's trying to load it without the .js extension. You can see the SystemJS config I have for the demo app for reference: https://github.com/crisbeto/angular-svg-round-progressbar/blob/master/demo/systemjs.config.js#L17

epot commented 7 years ago

Awesome, it works fine by adding a defaultExtension. I will check later if you fix the UMD file, but I can use the component so it is all good for now!