-
-
Notifications
You must be signed in to change notification settings - Fork 572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NullInjectorError: R3InjectorError(AppModule)[TranslateService -> TranslateService -> TranslateService]: NullInjectorError: No provider for TranslateService! #1324
Comments
I'm facing the same issue. I moved to Angular 12 my library and the project using it, and now Translate service injection fails. This is what I found so far : kubeflow/kubeflow#6042 It looks like ngx-translate won't be compatible with angular 13 nor angular 12 without ViewEngine. I couldn't find any workaround and angular i18n doesn't fit my needs so I will write my own translate pipe and translation service. |
yes, me too... |
I added the HttpClientModule to my imports and works fine for me. 🚀 Your app.module.ts must be like that:
|
@EliseiNicolae, what is your Angular version? |
@hotequil |
Thanks! |
When importing the @NgModule({
imports: [
TranslateModule.forChild(),
],
})
export class GlobalLoadingModule {} |
I'll close this issue because I back my Angular version. |
ncaught SyntaxError: Cannot use import statement outside a module (at scripts.js:16887:1)
|
Current behavior
I have an Angular Library, it import
TranslateModule
in some shared modules, and i use this library at my principal application as a NPM dependency, in my AppModule at principal application, i import theTranslateModule.forRoot(Translate.configurations)
with my configurations, my two applications compile correctly, but my translations at my library throws:NullInjectorError: R3InjectorError(AppModule)[TranslateService -> TranslateService -> TranslateService]: NullInjectorError: No provider for TranslateService!
and the system stop. This starting happening when i update the Angular version, it was 11.2.11 and now is 12.1.4. I saw a lot of isues with this problem, but none helped me. In my application the versions is the same. The terminal compile OK.Expected behavior
I expected the application translate my texts and no breaking.
How do you think that we should fix this?
I think that it's just a incorrect import or something like.
A module at my Angular Library
AppModule at my application
Browser:
For Tooling issues:
The text was updated successfully, but these errors were encountered: