infinitycube/gravatar

Importing GravatarModule into AppModule as suggested in README causes ERROR

Closed this issue · 8 comments

I'm having trouble doing a production build with this library. So I read the README and it suggests that I import the GravatarModule into my AppModule imports array. When I do this, I get an error that GravatarModule defined in /node_modules/@infinitycube/gravatar/src/gravatar.module.d.ts doesn't have the necessary @NgModule annotation to be an importable module.

ERROR in : Unexpected value 'GravatarModule in path/to/app/node_modules/@infinitycube/gravatar/src/gravatar.module.d.ts' imported by the module
'AppModule in path/to/app/src/app/app.module.ts'. Please add a @NgModule annotation.

I'm experiencing the same thing.

Same here. However, it works fine on simple build (and with ng serve), for me it fails when I try to use the -prod flag on build.

I found this : angular/angular#15763

EDIT: Updating NPM to v8.9.4 did not work, still the same issue.

I finally implemented Gravatar in my PHP backend... and used a simple tag like so:
<img [src]="user.gravatar" alt="user avatar" /> which is also very simple. Only thing is that it's less obvious on how to change the size and default image. I used the big image and adapted the css depending on the use case (should also be more retina friendly).

More info here on how to generate the hash : https://en.gravatar.com/site/implement/hash/
The final link should look like this: https://www.gravatar.com/avatar/<hash>.jpg?d=mm where mm is the default image.

Same issue here.

Same issue here

Same issue here

I have the same issue. It looks like no one maintains this repo.

Old build system scrapped due to various bugs. Now @infinitycube/gravatar@2.0.3 supports Angular 6 or later. We are working on a branch to support Angular 4 and 5. Hope this resolve the issue.