David Ewins
Error library

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' directive

Cause

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 --noEmit

Locally the file also goes stale silently; regenerate it if local and CI disagree.

More Expo errors

Search all errors