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
I found a similar unsolved discussion regarding the "Invalid languages" error in the Dify repository. You can check it out here: dify-web got Invalid languages error[1].
Regarding the issue you're facing, the error message "Invalid languages: " suggests that the languages array is being populated with an invalid entry, specifically the '' character. This typically happens when the locale is not correctly set or recognized.
Here are a few things you might want to check:
Locale Cookie: Ensure that the locale cookie is correctly set to a valid language code. The expected format should match one of the supported languages, such as en-US or zh-Hans[2].
Helm Chart Configuration: Verify the i18n.locale setting in your Helm chart configuration. It should be set to a supported language, like en or zh-CN[3].
Server Code: In the server.ts file, the languages array is populated from cookies and request headers. If the locale is not correctly set in the cookie, the Negotiator library will attempt to determine the preferred languages from the request headers. Ensure that the headers are correctly configured and that the Negotiator is functioning as expected [4].
By addressing these areas, you should be able to resolve the "Invalid languages" error. If the issue persists, further investigation into the server-side handling of locales might be necessary.
Self Checks
Dify version
0.10.0
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
I deploy dify on Kubernetes with helm chart. This error always happen in the dify-web pod:
I can find the locale cookie is en in the browser cache.
But it got * in frontend application.
Source:
dify/web/i18n/server.ts
Lines 41 to 53 in b674c59
✔️ Expected Behavior
No error.
❌ Actual Behavior
The error happened every minute.
The text was updated successfully, but these errors were encountered: