I'm trying to internationalize my angular app. Unfortunately, I get this error message " Types have separate declarations of a private property 'handler'. " I know that there is already a thread about it, but the solution is not working for me, I tried to change dependencies versions, and I still get this error. The problem occurs when I try to create and export a function that reutnrs http.
app.module.ts
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
imports: [
BrowserModule,
AppRoutingModule,
HttpClientModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: (createTranslateLoader),
deps: [HttpClient],
},
defaultLanguage: 'en-US',
}),
],
providers: [],
bootstrap: [AppComponent],
})
export class AppModule {}
export function createTranslateLoader(http: HttpClient) {
return new TranslateHttpLoader(http); => the problem occurs at http.
I had a similar issue as you are describing. What caused the error was that I was trying to use an external package (as a peer dependency) and it wasn't being added to the main project. Adding that package as a devDependency solved my issue.