Angular universal server error: When using the default fallback, a fallback language must be provided in the config Angular universal server error: When using the default fallback, a fallback language must be provided in the config express express

Angular universal server error: When using the default fallback, a fallback language must be provided in the config


I also faced the same problem, so I would just like to share my findings for the same.

For me, there were two plausible causes/solutions for it:

  • First, in my project's I18N default JSON file that was en.json, I was having a problem In the structure of the JSON file.

For example, I had the below mistake. I missed the comma after the second label 'FINISH' :

{"COMMON": {    "EDIT": "Edit",    "FINISH": "Finish"    "QUIT": "Quit",   }}

So after correcting the structure, the application ran fine without an error.

  • Secondly, another cause of the issue could be, at runtime transloco was not able to find the correct label in the selected language, so it looked for a fallback language and it could not even find that in the transloco-root.module.ts so after adding my fallback language, it tried to find the same in the fallback language as specified in the transloco-root.module.ts.

So it found out that label and the issue got resolved.

BUT in the second solution provided, you need to have that incorrect label in at least that fallback language's json file in correct format.

I added the fallback language like below:

useValue: translocoConfig({            availableLangs: ['fr', 'en'],            defaultLang: 'en',            reRenderOnLangChange: true,            fallbackLang: 'fr',            prodMode: environment.production,            missingHandler: {                logMissingKey: true            }        })


i18n Transloco wasn't fully configured on the module file.