#31605·immich

Mobile app crashes / logs out when device locale is `yue-Hant` (Cantonese) — `Invalid locale "yue-Hant"` in DateFormat

Author: pretubedongitCreated Sep 16, 2026Updated Sep 17, 2026
Labels📱mobile

I have searched the existing issues, both open and closed, to make sure this is not a duplicate report.

  • Yes

The bug

When the device system/preferred language is set to Cantonese (yue-Hant), the Immich mobile app throws unhandled exceptions and becomes unstable: The in-app Log page crashes when building each row, because DateFormat is constructed with the unsupported locale yue-Hant:

severe | ImmichErrorLogger | FlutterError - Catch all
Exception: Invalid argument(s): Invalid locale "yue-Hant"
Library: widgets library
#0  _throwLocaleError (package:intl/src/intl_helpers.dart:246)
#1  verifiedLocale (package:intl/src/intl_helpers.dart:240)
#2  verifiedLocale (package:intl/src/intl_helpers.dart:216)
#3  new DateFormat (package:intl/src/intl/date_format.dart:267)
#4  AppLogPage.build.<anonymous closure> (package:immich_mobile/pages/common/app_log.page.dart:108)

Text fields (including the login screen) repeatedly throw, because there is no Cantonese MaterialLocalizations delegate and MaterialLocalizations.of(context) returns null:

Exception: Null check operator used on a null value
Library: gesture / widgets library
#0  TextSelectionGestureDetectorBuilder.editableText (package:flutter/src/widgets/text_selection.dart:2377)
...
#0  MaterialLocalizations.of (package:flutter/src/material/material_localizations.dart:718)
#1  _TextFieldState._getEffectiveDecoration (package:flutter/src/material/text_field.dart:1205)

Root cause This is the known upstream limitation in the Dart intl package — it has no locale data for yue (Cantonese) and no graceful fallback, so constructing a DateFormat with yue-Hant throws immediately. See dart-lang/i18n#752 ("Invalid locale yue_Hant_HK") and the related fallback-handling issues. The suggestion there is to validate the platform locale on startup and fall back to a supported locale (e.g. en_US or zh-Hant) before passing it to DateFormat / MaterialLocalizations. Expected behavior The app should not crash or force a logout when the device locale is unsupported. It should detect unsupported locales (like yue-Hant) and fall back to a supported one (e.g. zh-Hant or en_US), or call initializeDateFormatting / guard the DateFormat construction so the Log page and text fields render normally.

The OS that Immich Server is running on

debian

Version of Immich Server

v3.2.1

Version of Immich Mobile App

v3.2.1

Platform with the issue

  • Server
  • Web
  • Mobile

Device make and model

iPhone 17 Pro

Your docker-compose.yml content

Not related to docker-compose. This is an iOS client only issue.

Your .env content

Not related to env. This is an iOS client only issue.

Reproduction steps

  1. Set the device system/preferred language to Cantonese (Traditional) (yue-Hant / yue-Hant-HK).
  2. Launch the Immich mobile app.
  3. Open the in-app Log page (or tap into the server-URL / login text field).
  4. Observe the Invalid locale "yue-Hant" crash on the Log page and the repeated Null check operator used on a null value errors from MaterialLocalizations.of on text fields.

Relevant log output

Exception: Invalid argument(s): Invalid locale "yue-Hant"
#3  new DateFormat (package:intl/src/intl/date_format.dart:267)
#4  AppLogPage.build.<anonymous closure> (package:immich_mobile/pages/common/app_log.page.dart:108)

Exception: Null check operator used on a null value
#0  MaterialLocalizations.of (package:flutter/src/material/material_localizations.dart:718)
#1  _TextFieldState._getEffectiveDecoration (package:flutter/src/material/text_field.dart:1205)

Additional information

Related upstream issue: dart-lang/i18n#752 — Invalid locale "yue_Hant_HK" with the same verifiedLocalenew DateFormat stack trace. A isLocaleSupported / fallback check on startup would prevent this class of crashes for any unsupported locale (yue, sco, nap, ars, gd, etc.).