Core: Error, when using strictTemplates in Angular 9.

Created on 27 Feb 2020  路  13Comments  路  Source: ngx-translate/core

Enabling the new strictTemplates flag in Angular 9's compiler options generates the following build error:

This likely means that the library (@ngx-translate/core) which declares TranslateModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to 
see if the library is expected to be compatible with Ivy.

Most helpful comment

Hi guys, this fixed the problem for me:
npm cache verify

Remove the node modules
rm -rf node_modules

And npm install again and it works properly.

All 13 comments

I'm having the exact same problem after moving to Angular 9. Has anyone had a chance to look into this?

Same problem here. Ngx-translate is no longer compatible with Angular?

Same problem here. It can't solve it yet. Some have any solution?

Hi guys, this fixed the problem for me:
npm cache verify

Remove the node modules
rm -rf node_modules

And npm install again and it works properly.

@Cfvillarroel Thanks, fixed mine also.

Same error @Cfvillarroel solution didn't fix mine

ERROR in node_modules/@ngx-translate/http-loader/lib/http-loader.d.ts:4:22 - error NG6002: 
Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.

This likely means that the library (@ngx-translate/http-loader) which declares 
TranslateHttpLoader has not been processed correctly by ngcc, or is not compatible with Angular 
Ivy. Check if a newer version of the library is available, and update if so. Also consider checking
with the library's authors to see if the library is expected to be compatible with Ivy.

@Cfvillarroel fvillarroel Works for me! Thanks!

Hi guys, this fixed the problem for me:
npm cache verify

Remove the node modules
rm -rf node_modules

And npm install again and it works properly.

I'm facing same issue as @MrRaymondVO. Fix don't work. Used latest versions of Angular 9 and ngx-translate.

@Cfvillarroel Thanks,
guys, this fixed the problem for me:
npm cache verify

@mdudek I was able to fixit this way in the app module
TranslateModule.forRoot({ loader: { provide: TranslateLoader, useFactory: (http: HttpClient) => { return new TranslateHttpLoader(http, "./assets/i18n/", ".json"); }, deps: [HttpClient], }, }),

I have same issue. The fix don't work.

@mdudek I was able to fixit this way in the app module
TranslateModule.forRoot({ loader: { provide: TranslateLoader, useFactory: (http: HttpClient) => { return new TranslateHttpLoader(http, "./assets/i18n/", ".json"); }, deps: [HttpClient], }, }),

@MrRaymondVO Thanks a lot, it worked! Can you explain a bit?

@atj393 basically this is what I did
image

Was this page helpful?
0 / 5 - 0 ratings