When the application initializes, i18next attempts to load locale files based on the browser language (e.g. de-DE).
The backend only provides base language files (e.g. de.json, en.json), but not regional variants like de-DE.json.
As a result:
- GET /api/v1/locales/de-DE.json → 406 Not Acceptable
- Response body is empty (Content-Length: 0)
- The frontend does not handle this failure gracefully
This leads to a runtime error:
TypeError: Cannot read properties of null (reading 'data')
And finally React rendering fails during initialization.
Observed Behavior:
Despite valid fallback languages being loaded, the failed de-DE request causes the app to crash.
Expected Behavior:
The app should either
- Normalize de-DE → de before requesting locale files, or
- Gracefully fall back to de / en if a regional locale is not available
A failed locale request must not crash the application
Assumed root cause:
Frontend configuration uses:
This forces i18next to load the exact locale (de-DE) instead of falling back to the base language (de).
Backend only supports base locales (de, en) and returns 406 for unsupported locales.
Additionally, the frontend does not defensively handle failed HTTP responses.
Besides that, I suggest to ensure that HTTP failures are handled safely.
Avoid assuming response shape (response.data) without validation.
When the application initializes, i18next attempts to load locale files based on the browser language (e.g. de-DE).
The backend only provides base language files (e.g. de.json, en.json), but not regional variants like de-DE.json.
As a result:
This leads to a runtime error:
And finally React rendering fails during initialization.
Observed Behavior:
Despite valid fallback languages being loaded, the failed de-DE request causes the app to crash.
Expected Behavior:
The app should either
A failed locale request must not crash the application
Assumed root cause:
Frontend configuration uses:
load: 'currentOnly'This forces i18next to load the exact locale (de-DE) instead of falling back to the base language (de).
Backend only supports base locales (de, en) and returns 406 for unsupported locales.
Additionally, the frontend does not defensively handle failed HTTP responses.
Besides that, I suggest to ensure that HTTP failures are handled safely.
Avoid assuming response shape (response.data) without validation.