TypeScript "TS18003: No inputs were found in config file"
tsc resolved your tsconfig.json but its include/files/exclude globs matched zero source files. The compiler has nothing to compile, so it errors out instead of silently doing nothing.
What this error means
tsc fails with error TS18003: No inputs were found in config file '<path>', echoing the include/exclude patterns. It often appears when running from the wrong directory or against a partial checkout.
error TS18003: No inputs were found in config file '/app/tsconfig.json'.
Specified 'include' paths were '["src/**/*"]' and 'exclude' paths were
'["node_modules","dist"]'.Diagnose it: which tsconfig and which compiler?
A TypeScript error that appears only in CI usually means the runner is compiling with a different config or a different compiler version than your editor. Your editor uses the workspace TypeScript and the nearest tsconfig.json; CI uses whatever the lockfile resolved and whatever config the build script names.
# what CI will actually use
npx tsc --version
npx tsc --showConfig | head -40
# which files are in the program (a missing include is a common cause)
npx tsc --listFiles | wc -l
# type-check only, no emit, same as most CI gates
npx tsc --noEmitCommon causes
include/files match no files
The include glob points at a directory that does not exist or is empty (e.g. src/ when sources live in lib/), or exclude removes everything that include matched.
Wrong working directory or partial checkout
Running tsc from the wrong cwd, or a sparse/shallow checkout that omits the source directory, leaves the configured paths empty in CI.
How to fix it
Point include at real source paths
Make the globs match where your code actually lives.
// tsconfig.json
{
"include": ["src/**/*.ts", "src/**/*.tsx"],
"exclude": ["node_modules", "dist"]
}Run from the right directory with the right config
- Confirm cwd:
tsc -p ./tsconfig.jsonfrom the project root. - Check the checkout actually contains the source directory in CI.
- List what tsc sees with
tsc --listFilesOnly -p tsconfig.json.
Pin the compiler so unrelated updates cannot break the gate
TypeScript adds errors in minor releases. An unpinned compiler turns a routine dependency update into a red build on code nobody touched, which is the most common false alarm in a TypeScript CI pipeline.
// package.json
{
"devDependencies": {
"typescript": "5.6.3" // exact, not ^5.6.3
}
}How to prevent it
- Keep
includealigned with your real source layout. - Run tsc from a consistent working directory in CI.
- Ensure the checkout includes all source paths the config references.