You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which Transloco package(s) are the source of the bug?
Transloco
Is this a regression?
No
Current behavior
Angular 17 (standalone) Micro Frontend loads Transloco properly when loaded as a standalone application.
When hosted using module federation, the host gives the following errors:
core.mjs:11806 ERROR Error: NG0200: Circular dependency in DI detected for .
Problem can be mitigated if I bootstrap the host app with Transloco as well. This creates coupling I don't think should exist as host shouldn't be aware of the MFE translation files location.
I've tried also to solve this with scopes unsuccessfully.
This is my setup in app.config.ts in MFE (if I add this to host, the problem goes away, as mentioned) provideTransloco({ config: { defaultLang: 'en', reRenderOnLangChange: true, prodMode: !isDevMode(), availableLangs: LANGUAGE_MAP(), }, loader: TranslocoHttpLoader, }),
Expected behavior
I would expect setup of Transloco in micro frontend to be independent of its host.
Please provide a link to a minimal reproduction of the bug, if you won't provide a link the issue won't be handled.
ERROR NullInjectorError: R3InjectorError(_AppModule)[_TranslocoService -> InjectionToken TRANSLOCO_TRANSPILER -> InjectionToken TRANSLOCO_TRANSPILER]:
NullInjectorError: No provider for InjectionToken TRANSLOCO_TRANSPILER!
We've ensured that all dependencies are properly installed and up-to-date.
The error seems to be related to the injection of TRANSLOCO_TRANSPILER, but we're unsure why it's not being provided.
EDIT:
I managed to resolve the issue by following the ngneat Transloco documentation closely (in my case i had to stick to the NgModule approach ).
I refactored the old TranslocoRootModule as follows:
Is there an existing issue for this?
Which Transloco package(s) are the source of the bug?
Transloco
Is this a regression?
No
Current behavior
Angular 17 (standalone) Micro Frontend loads Transloco properly when loaded as a standalone application.
When hosted using module federation, the host gives the following errors:
Problem can be mitigated if I bootstrap the host app with Transloco as well. This creates coupling I don't think should exist as host shouldn't be aware of the MFE translation files location.
I've tried also to solve this with scopes unsuccessfully.
This is my setup in app.config.ts in MFE (if I add this to host, the problem goes away, as mentioned)
provideTransloco({ config: { defaultLang: 'en', reRenderOnLangChange: true, prodMode: !isDevMode(), availableLangs: LANGUAGE_MAP(), }, loader: TranslocoHttpLoader, }),
Expected behavior
I would expect setup of Transloco in micro frontend to be independent of its host.
Please provide a link to a minimal reproduction of the bug, if you won't provide a link the issue won't be handled.
''
Transloco Config
Please provide the environment you discovered this bug in
Browser
Additional context
No response
I would like to make a pull request for this bug
No
The text was updated successfully, but these errors were encountered: