question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Get 'language is not included' error on first time page request

See original GitHub issue

When I request page at first time. I get Invalid configuration: Current language is not included in all languages array in the browser console.

Also, If I remove i18next cookie and then refresh the page. The error message is occurred too.

This error message is only occurred when I enable localeSubpaths.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:38 (35 by maintainers)

github_iconTop GitHub Comments

1reaction
capellinicommented, Feb 7, 2019

If you do not want changeLanguage('en-US') to be called, and therefore want to assert that allLanguages.includes(currentLanguage) when a language change occurs, then you cannot do so while config.load === 'languageOnly'.

If the intended behavior is for someone who prefers 'en-US' to have their language set to 'en', and to not support a whitelist that has regional locales, then you can assert something like allLanguages.includes(currentLanguage.slice(0, 2)). However, in practice, users’ accept-language headers that contain 'en-US' will most likely also include 'en' somewhere in it, as well.

Setting config.load = 'currentOnly' ensures that allLanguages will always include currentLanguage and that the only languages that we attempt to use are the ones that are on our whitelist.

0reactions
capellinicommented, Feb 9, 2019

@isaachinman Sorry - just getting to this now. I believe that’s all that was needed. You’re most welcome.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get 'language is not included' error on first time page request
When I request page at first time. I get Invalid configuration: Current language is not included in all languages array in the browser ......
Read more >
What went wrong? Troubleshooting JavaScript - MDN Web Docs
This one is pretty simple — it generally means that you've missed the closing parenthesis at the end of a function/method call. Note:...
Read more >
Common .NET Software Errors and How to Fix Them - Stackify
We've aggregated the 50 top .NET software errors. It includes exceptions, broken data bindings, memory leaks, etc. Find solutions on ways to ...
Read more >
Rails Internationalization (I18n) API - Ruby on Rails Guides
Getting the locale from params and setting it accordingly is not hard; including it in every URL and thus passing it through the...
Read more >
Design-time errors in the Windows Forms Designer
Error message: "A requested language parser is not installed. The language parser name is '{0}'." Visual Studio attempted to a load a designer ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found