TS18003: No inputs were found in config file
TS18003 means include, exclude and extends produced an empty file set. Print the resolved config, then fix the path, the base config or the sources.

Introduction & Quick Summary
error TS18003: No inputs were found in config file '/repo/tsconfig.json'.
Specified 'include' paths were '["src/**/*"]' and 'exclude' paths were '["node_modules"]'.TS18003 is not a type error. It means the compiler resolved your tsconfig.json, computed the set of input files from files, include and exclude, and the set came out empty. Nothing was checked because nothing was found, so the build is red while every source file may still be perfectly valid.
The four causes worth checking first:
- The config is being read from a different directory than you think.
includeis relative to the directory that holds thetsconfig.json, not toprocess.cwd()or to the file that triggered the compile. - A parent config already narrowed
include."extends": "../../tsconfig.base.json"inheritsinclude,excludeandfilesunless the child overrides them, and relative paths are resolved against the inherited file's directory. excludecanceled everything. Excludingdist, then includingdist/**/*, leaves zero inputs. Negations inincludedo not restore order the way people expect.- The files are JavaScript or
.mts/.ctsand no matching extension is enabled.allowJsoff means.jsfiles are simply not inputs.
| Symptom | Real cause | Fix |
|---|---|---|
include looks correct but fails | Config nested deeper than expected | Print the resolved config, then fix relative paths |
Works in root, fails in packages/* | Inherited include from a base config | Redeclare include in the child |
| Fails only in Docker or CI | .dockerignore removed src/ | Copy sources before tsc |
Fails with src deleted by a script | clean script ran before tsc | Order the pipeline correctly |
Only .js files in the folder | allowJs is false | Enable allowJs or point at .ts files |
Core Mechanics, Signatures & Reproducible Setup
The compiler builds the program from a file list. files is an explicit array with no globbing. include is an array of glob patterns resolved against the config directory. exclude removes matches, but it only filters what include produced, and it always defaults to node_modules, bower_components, jspm_packages and the outDir when omitted. Extensions considered are .ts, .tsx, .d.ts by default, plus .js, .jsx with allowJs, plus .mts/.cts and .mjs/.cjs in modern versions.
Reproduce it in one directory:
mkdir -p /tmp/ts18003/src && cd /tmp/ts18003
cat > tsconfig.json <<'JSON'
{
"compilerOptions": { "strict": true, "noEmit": true },
"include": ["app/**/*"]
}
JSON
cat > src/index.ts <<'TS'
export const answer: number = 42;
TS
npx -p typescript@5 tsc -p tsconfig.json
# error TS18003: No inputs were found in config file '/tmp/ts18003/tsconfig.json'.Print what the compiler actually resolved instead of guessing:
npx tsc -p tsconfig.json --showConfig | head -40--showConfig prints the effective configuration with every inherited value already merged, which is the fastest way to see a stray include from a base file.
Inside a monorepo the same failure appears when the package config only extends:
{
"extends": "../../tsconfig.base.json",
"compilerOptions": { "outDir": "dist" }
}If the base file sets "include": ["src"], the child inherits the string but resolves it against the base file's directory, so it points at the repository root's src from the compiler's point of view only after merging. Always redeclare in the leaf package:
{
"extends": "../../tsconfig.base.json",
"compilerOptions": { "outDir": "dist", "rootDir": "src" },
"include": ["src/**/*.ts", "src/**/*.tsx"],
"exclude": ["dist", "node_modules"]
}A second reproducible trap is the exclude that swallows the only source folder:
{
"include": ["src/**/*"],
"exclude": ["src"]
}This yields TS18003 with a config that looks self-consistent. exclude wins over include for the same path.
Key Comparison Table
| Field | Relative to | Inherited via extends | Glob support | Typical mistake |
|---|---|---|---|---|
files | Config directory | Yes, replaced wholesale | None | Listing a directory |
include | Config directory | Yes, replaced wholesale | Yes (**, *, ?) | Assuming CWD |
exclude | Config directory | Yes, replaced wholesale | Yes | Excluding the only source |
extends path | Config directory | n/a | No | Relative to CWD |
allowJs | n/a | Yes | n/a | Expecting .js inputs |
| Runner | Working directory used for include | Extra trap |
|---|---|---|
tsc -p path/to/tsconfig.json | The config's own folder | None |
ts-node | The config's own folder | Ignores include for type checking by default |
tsc --build (project references) | Each referenced project's folder | composite requires rootDir coverage |
next build | Project root | Next.js generates its own config fields |
vite build | Project root, via esbuild | Type checking is skipped entirely |
Practical Edge Cases, Error Fixes & Deep Dive Code Examples
Case 1: The config lives one level too deep
A layout such as config/tsconfig.json with "include": ["src"] points at config/src. Use ../src/**/* or, better, keep the config at the package root and let tooling reference it.
find . -name tsconfig.json -not -path "*/node_modules/*" -maxdepth 3Case 2: extends inherits a relative include
The merged path is resolved against the file where the pattern was written. A shared base at packages/config/tsconfig.base.json with "include": ["src"] means every package inherits a path into packages/config/src. Shared bases should omit include entirely and leave it to leaves.
Case 3: The build stage ran before the sources were copied
A Dockerfile that copies only manifests, runs npm ci, then runs tsc before COPY . . will always fail with TS18003.
FROM node:22-alpine AS build
WORKDIR /app
COPY package*.json tsconfig*.json ./
RUN npm ci
COPY . .
RUN npm run buildCase 4: A generated types folder is the only input
Projects that generate types into types/ and expect the folder to exist can fail on a clean clone because git does not track empty directories. Commit a placeholder file or use files: [] with project references.
mkdir -p types && printf 'export {};\n' > types/index.d.tsCase 5: exclude with a negation that does not do what it reads like
{
"include": ["**/*.ts"],
"exclude": ["node_modules", "**/*.test.ts"]
}Negated patterns inside exclude are supported, but ["node_modules", "!node_modules/keep-me"] still keeps almost nothing, because include never matched inside node_modules first. Put the tests in a separate config.
Case 6: references without composite
{ "files": [], "references": [{ "path": "./packages/core" }] }A root config with files: [] is legitimate and does not raise TS18003 by itself, because references supplies the program. But if the referenced package lacks "composite": true, tsc --build skips it and the root looks empty again.
Common Compilation/Runtime Mistakes & Version Gotchas
- Case sensitivity. macOS and Windows resolve
Src/**/*tosrc/, Linux CI does not. Anincludethat works locally can return zero inputs in the build container. Check the exact casing of the directory. tscversion skew. TypeScript 5.x changed howincludeinteracts with--outDirand howexcludedefaults are computed; a lockfile that resolves a different compiler in CI than locally can change the input set without any config edit. Pin the compiler version.- Editor versus build. The language server may report none of this because it builds a program from the files you have open. TS18003 only appears on a real
tscrun, so trust the CLI. noEmithides nothing. SettingnoEmit: truedoes not skip input resolution; CI type checks still fail with TS18003.- Generated paths with spaces. An
includesuch asMy App/src/**/*needs no escaping in JSON, but shell wrappers that pass-ppaths can break.
When you need to inspect the exact JSON that a build consumed, run it through the JSON formatter after --showConfig so nesting and duplicate keys become obvious. For comparing a working config against a broken one, the diff tool keeps the two files side by side. And when a path pattern is the suspect, the regex tester helps confirm what **/* actually matches before you rewrite it.
Primary references: the TypeScript tsconfig.json reference documents include, exclude, files and inheritance, and the TSConfig handbook chapter covers how extends is resolved.
Official references
primary documentationThe TypeScript documentation that defines the behaviour this guide explains.
Try matching browser tools
All toolsSmall utilities that fit TypeScript work — they run entirely in this browser tab, so nothing you paste leaves your device.
Related TypeScript guides
All TypeScript guidesTypeScript TS2349: This expression is not callable
TS2349 means the value has no call signature at that point. Narrow unions, fix module default imports and guard optional calls instead of asserting.
TypeScript: Cannot find name 'process' with @types/node
TS2304 on process or Buffer means the compiler has no Node declarations. Install @types/node, stop excluding it, and align its version to the runtime.
TypeScript TS2339: Property does not exist on type
TS2339 means the declared type has no such member. Declare the shape, narrow unions and guard unknown values instead of casting at the read.
TypeScript TS2564: Property has no initializer and is not definitely assigned
TS2564 means the compiler can't prove a field is assigned before the constructor ends. Defaults, definite assignment and optional fields each fit one case.
More in TypeScript
All TypeScript guidesThe guides filed next to this one in TypeScript, in library order.