ng-lazyload-image: ERROR in Invalid provider for LazyLoadImageHooks. useClass cannot be undefined.

I got this error in an Angular9 project

ERROR in Invalid provider for LazyLoadImageHooks. useClass cannot be undefined.
           Usually it happens when:
           1. There's a circular dependency (might be caused by using index.ts (barrel) files).
           2. Class was used before it was declared. Use forwardRef in this case.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 3
  • Comments: 33 (10 by maintainers)

Most upvoted comments

I got this to compile by going back to the previous version: npm install ng-lazyload-image@7.0.1 I’m on Ionic 5.0.7 / Angular 8.2.14

@tjoskar this error occured at build time .

This should be fixed in version 9.0.0

Upgrading to 8.0.2-21 helped.