core icon indicating copy to clipboard operation
core copied to clipboard

Error: The pipe 'translate' could not be found!

Open RafaeldelM opened this issue 3 years ago • 5 comments

Hi! First of all, thanks for the ngx-translate project! It helped me a lot!! :-)

From my update to Angular 10, I get that error every 2-3 changes:

Error: The pipe 'translate' could not be found!

The solution is to cancel the server and start it again. It takes 2 minutes every time. Do you know what can be the problem?

Thanks,

Rafa

RafaeldelM avatar Nov 02 '20 14:11 RafaeldelM

I have the same problem, it is probably something wrong with angular hot reload, since restarting angular fixes it. It only happens on one of my computers, and with other pipes too. I'm not sure what causes it but i suspect it might be a certain node version.

GotBinGo avatar Nov 03 '20 05:11 GotBinGo

Hi, I'm getting the same errormessage as mentioned above. I made a stackblitz demontstrating my issue. The translate pipe works in my root module, but not in a feature module which imports SharedModule. TranslateModule is exported in SharedModule

image

Restarting doesn't help in my case, I always get the error message. My editor (webstorm) states that the translate pipe IS available when importing SharedModule in FeatureModule.

thomastvedt avatar Nov 10 '20 13:11 thomastvedt

@thomastvedt your problem is that FeatureModule is not imported in AppModule, it is interesting why it works if there is no translate pipe in PersonComponent. It is probably some weirdness of ivy.

GotBinGo avatar Nov 11 '20 15:11 GotBinGo

@thomastvedt your problem is that FeatureModule is not imported in AppModule, it is interesting why it works if there is no translate pipe in PersonComponent. It is probably some weirdness of ivy.

Thank you @GotBinGo ! 🙈 😄

thomastvedt avatar Nov 12 '20 08:11 thomastvedt

This might happen because of missing dependency injection for ngx-translate service.

import { TranslateService } from "@ngx-translate/core";

private translate: TranslateService add into your constructor() method on all the components where you are using translate pipe

It's working fine for me

manoj10101996 avatar Aug 05 '21 11:08 manoj10101996