I try to switch my application to AoT compilation and get this error in the working environment when the application loads (it works fine locally).
Error: Can't resolve all parameters for IconService: (?, ?)
it seems that the error comes from the modules providing the IconService. Icon Services Designer looks like
constructor(private http:Http, private iconConfiguror:IconConfiguror) {
So, my question is what this error means and why it will only happen in the prod environment (I tried to enable local prod mode)?
This seems to mean that no http and icon configuration parameters are specified, but the icon configuration is provided at the application module level, and the HttpModule imported into IconModule , where the IconService provided.
@NgModule({ imports: [ CommonModule, HttpModule, ], declarations: [ IconComponent, ], exports: [ IconComponent, ], providers: [ IconService, __platform_browser_private__.BROWSER_SANITIZATION_PROVIDERS, ], })
And a 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";
source share