CI typecheck fails (or passes with a broken href) because .expo/types is missing
ExpoConfirmed fix
expo-router typedRoutes, SDK 57
Error
error TS2578: Unused '@ts-expect-error' directiveCause
Typed routes are generated into .expo/types/router.d.ts by the dev server, and .expo is gitignored. A fresh checkout typechecks against looser default types: it can invent errors, and it can also pass with a typo in an href.
Fix
There is no expo typegen command. In CI, start the dev server briefly so it writes the file, then typecheck:
shell
(npx expo start --offline > /dev/null 2>&1 &) ; sleep 15 ; npx tsc --noEmitLocally the file also goes stale silently; regenerate it if local and CI disagree.
More Expo errors
- Dev client red screen: No script URL provided (launcher never appears)No script URL provided
- Bundle fails with Invalid expression encountered after supabase-js updateInvalid expression encountered
- After upgrading to SDK 57, expo-font / expo-image / expo-asset config is missing
- SDK upgrade: export dies with SyntaxError after expo install --fixSyntaxError: ... Unable to determine event arguments for "onModeChange"
- expo-doctor wants TypeScript 6 but tsc reports hundreds of errors