-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't resolve all parameters for ScrollHooks #476
Comments
i also facing this kind of issue while using |
What version of Angular are you using? |
Angular 8.3 |
Are you using the ScrollHook? Or how does your setup look like? |
Does it look someting like: import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { LazyLoadImageModule, LAZYLOAD_IMAGE_HOOKS, ScrollHooks } from 'ng-lazyload-image';
import { AppComponent } from './app.component';
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, LazyLoadImageModule],
providers: [{ provide: LAZYLOAD_IMAGE_HOOKS, useClass: ScrollHooks }],
bootstrap: [AppComponent],
})
export class MyAppModule {} |
Yes, the imports are exactly like that in the App Module class. |
@tjoskar i've also implemented like the same. i also getting same error |
I will need to create a Angular 8.3 project in order to debug this. Is it possible for you to share your code or create a small repo where you can reproduce the error? Or give me your package.json file. |
{ |
I am also facing this same error. Same parameters as the above comments. |
I can confirm that this is a bug in Angular 8 (I can not reproduce it in Angular 10). It is probably because of this line:
It looks like this works for now: import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { LazyLoadImageModule, LAZYLOAD_IMAGE_HOOKS, ScrollHooks } from 'ng-lazyload-image';
import { AppComponent } from './app.component';
// Create a custom class with no constructor arguments
export class MyScrollHooks extends ScrollHooks {
constructor() {
super()
}
}
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, LazyLoadImageModule],
providers: [{ provide: LAZYLOAD_IMAGE_HOOKS, useClass: MyScrollHooks }],
bootstrap: [AppComponent],
})
export class AppModule {} |
Reference angular app can be found here: https://github.com/tjoskar/ng-lazyload-image-bugs/blob/master/476-cant-resolve-all-parameters-for-ScrollHooks/src/app/app.module.ts |
Thanks! That fixed it! I didn't realize how far back my angular version was. So I've updated to the newest version. |
A fix is included in |
I'm getting the error ERROR in Can't resolve all parameters for ScrollHooks in C:/.........../node_modules/ng-lazyload-image/ng-lazyload-image.d.ts: (?). This only happens when doing ng build --prod but works fine with ng build. I have tries npm install ng-lazyload-image --save-prod with no success.
The text was updated successfully, but these errors were encountered: