I've been trying to switch my app over to AoT compilation and have been getting this error in the production environment when the app is loading (it works fine locally).
Error: Can't resolve all parameters for IconService: (?, ?)
it seems like the error is coming from on the modules that is providing the IconService. The icons services constructor looks like
constructor(private http:Http, private iconConfiguror:IconConfiguror) {
So my question is what does this error mean and why would it happen in the prod environment only (I've tried enabling prod mode locally)?
It seems like it means that the http and icon configuration parameters aren't provided, but the icon config is provided at the app module level and the HttpModule is imported in the IconModule where the IconService is provided.
@NgModule({ imports: [ CommonModule, HttpModule, ], declarations: [ IconComponent, ], exports: [ IconComponent, ], providers: [ IconService, __platform_browser_private__.BROWSER_SANITIZATION_PROVIDERS, ], }) And the barrel for our icon component.
export * from "./components/icon/icon.configuror"; export * from "./components/icon/icon.service.provider"; export * from "./components/icon/icon.service"; export * from "./components/icon/icon.component"; export * from "./components/icon/icon.module";
constructor(private http:Http, private iconConfiguror:IconConfiguror)__decorateis correct, they should not be injected there. How are you providing theIconConfigurorservice?{provide: IconConfiguror, useClass: IconConfigurorImpl},. And the IconConfigurorImpl itself@Injectable() export class IconConfigurorImpl extends IconConfiguror {