From d9068ab5c8563d35f580df2b2ff2711bcb2953bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20=C5=A0=C4=87eki=C4=87?= Date: Tue, 25 Aug 2026 11:27:35 +0200 Subject: [PATCH] fix(mobile): make app.config.ts resolve the languages import The Expo config loader transpiles app.config.ts and hands the result to Node, which resolves require('./x.ts') but not the extensionless require('./x'). Every other app.config.ts import points at a hand-written .js sibling; the languages import added by #5444 has none, so `expo config` failed with "Cannot find module './src/i18n/languages'". That broke the nightly kilo-app release preflight (eas-cli spawns `expo config --json`) and every local mobile prebuild. Import the module with its .ts extension and allow the extension in the app's tsconfig. Moving the list into a .js sibling was the alternative; it widens SUPPORTED_LANGUAGES to string[] and breaks the SupportedLanguage union that ten call sites depend on. Read the config in kilo-app CI too. The release preflight was the only job that evaluated app.config.ts, and it runs nightly, so a broken import reached main twice. --- .github/workflows/kilo-app-ci.yml | 5 +++++ apps/mobile/app.config.ts | 2 +- apps/mobile/tsconfig.json | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/kilo-app-ci.yml b/.github/workflows/kilo-app-ci.yml index 1c0a951080..1bfed09671 100644 --- a/.github/workflows/kilo-app-ci.yml +++ b/.github/workflows/kilo-app-ci.yml @@ -65,6 +65,11 @@ jobs: - name: Typecheck run: pnpm --filter kilo-app run typecheck + # The release preflight is the only other job that evaluates app.config.ts, + # and it runs nightly. Read the config here so a broken import fails the PR. + - name: Read Expo config + run: pnpm --filter kilo-app exec expo config --type public > /dev/null + lint: runs-on: ${{ vars.RUNNER_DEFAULT_LABEL || 'ubuntu-latest' }} timeout-minutes: 15 diff --git a/apps/mobile/app.config.ts b/apps/mobile/app.config.ts index 22988dad73..fcf03d8964 100644 --- a/apps/mobile/app.config.ts +++ b/apps/mobile/app.config.ts @@ -1,6 +1,6 @@ import type { ExpoConfig } from 'expo/config'; import { ENV_KEYS, OPTIONAL_ENV_KEYS } from './src/lib/env-keys'; -import { SUPPORTED_LANGUAGES } from './src/i18n/languages'; +import { SUPPORTED_LANGUAGES } from './src/i18n/languages.ts'; import { SENTRY_NATIVE_OPTIONS } from './src/lib/sentry-dsn'; import { UNIVERSAL_LINK_PATH_PATTERNS } from './src/lib/universal-link-paths'; import { diff --git a/apps/mobile/tsconfig.json b/apps/mobile/tsconfig.json index 87c03988c8..57579343b5 100644 --- a/apps/mobile/tsconfig.json +++ b/apps/mobile/tsconfig.json @@ -2,6 +2,9 @@ "extends": "expo/tsconfig.base", "compilerOptions": { "strict": true, + // app.config.ts imports src/i18n/languages.ts with its extension: the Expo + // config loader resolves require('./x.ts') but not the extensionless form. + "allowImportingTsExtensions": true, "noUncheckedIndexedAccess": true, "paths": { "@/*": ["./src/*"],