Template parse errors: The pipe 'translate' could not be found
See original GitHub issueCurrent behavior
I try to upgrade my angular app from 6.1 to 7.0 and have this issue
Expected behavior
I have a shared Module (called ComponentsModule) whit this code
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { LoadingComponent } from './index.components';
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { HttpLoaderFactory } from '../app.module';
import { HttpClient } from '@angular/common/http';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http, "../../assets/i18n/", ".json");
}
@NgModule({
imports: [
CommonModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
}),
...
],
declarations: [
LoadingComponent,
...
],
exports: [
LoadingComponent,
...
TranslateModule
]
})
export class ComponentsModule { }
How do you think that we should fix this?
Minimal reproduction of the problem with instructions
And I import to this module to the app
import { NgModule } from '@angular/core';
import { ComponentsModule } from './components/components.module';
@NgModule({
declarations: [
...
],
imports: [
ComponentsModule,
...
],
providers: [
...
],
bootstrap: [AppComponent]
})
export class AppModule { }
But whe try to npm run build
Have this error:
ERROR in : Template parse errors: The pipe ‘translate’ could not be found (“esourceService.loading”> <span> {{ [ERROR ->]‘LOADING’ | translate }}…</span>
</div>"): D:/desarrollos/Patient Portal/patient-portal-demo/pp demo front/src/app/components/loading/loading.component.html@2:12
I read a lot of thread here
https://github.com/ngx-translate/core/issues/635
https://github.com/ngx-translate/core/issues/787
But all say its necesary to import TranslateModule
but as you can see I do it.
Sorry if this is not a bug, but I think it is with the upgrade to Angular 7
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:5
Top Results From Across the Web
Template parse errors: The pipe "translate" could not be found
Karma Jasmine unit testing causing Template parse errors: The pipe "translate" could not be found. Current behavior
Read more >The pipe 'translate' could not be found , angular2 component ...
I am working on component testing with angular2. in my html template i use the translate pipe. This is the ...
Read more >NG0302: The pipe 'translate' could not be found! - Ionic Forum
I have a strange issue with translate module. I try to describe the scenario: Main page ClubSettingsMenuComponent (it is a Popover Menu) ...
Read more >Fix Ngx-translate pipe not found in Angular 11 error [solved]
In this case I use a core module (which acts like a "shared" module). Within the core module is a header component which...
Read more >Template parse errors: The pipe 'translate' could not be found
Template parse errors : The pipe 'translate' could not be found. 解决办法:把the Translate module 重新导入导出in my app's shared module.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have solved the problem disable the Ivy in my tsconfig.json
tsconfig.json
"angularCompilerOptions": { "enableIvy": false }
I do not think it’s the best solution, but it works for me
I confirm it’s works ok if I downgrade angular from 7 to 6