Skip to content

Angular 8 and Ivy compatibility - No provider for InjectionToken TranslationsFormat #56

@Ismaestro

Description

@Ismaestro

Hi there!

I'm facing one problem after enable Ivy in my project. The problem is:

NullInjectorError: R3InjectorError(AppBrowserModule)[I18n -> InjectionToken TranslationsFormat -> InjectionToken TranslationsFormat -> InjectionToken TranslationsFormat]:
NullInjectorError: No provider for InjectionToken TranslationsFormat!

But I have this in the app module providers:

{
  provide: TRANSLATIONS,
  useFactory: (locale) => {
    locale = locale || 'en';
    return require(`raw-loader!../i18n/messages.${locale}.xlf`);
  },
  deps: [LOCALE_ID]
},
I18n,

You can check here the repository in the branch 'ivy' and see it in action.

BR
Isma

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions