TS18003Command Error
Since TS 2.1

Fix TS18003: No Inputs Were Found in Config File

Learn why TypeScript throws TS18003 when a tsconfig matches no source files, and how to fix include paths, allowJs, exclude and CI build contexts.

error TS18003: No inputs were found in config file 'X'. Specified 'include' paths were 'Y' and 'exclude' paths were 'Z'

What This Error Means

TS18003 means the compiler found your tsconfig.json, parsed it successfully, and then ended up with nothing to compile. This is not a type error and not a syntax error — tsc never got as far as reading a source file, because after resolving files, include and exclude the list of input files was empty. The compiler refuses to run on zero files rather than quietly producing an empty build.

The message is unusually helpful once you know how to read it. It quotes three things: the config file that produced the empty program, the include patterns it used, and the exclude patterns it used. Those are the only three inputs to the decision, so the answer is always visible in the error itself.

error TS18003: No inputs were found in config file '/app/tsconfig.json'.
  Specified 'include' paths were '["src/**/*"]' and 'exclude' paths were '[]'.
                                  ~~~~~~~~~~~                              ~~
                                  what tsc looked for      what it threw away

One rule explains most surprises: only .ts, .tsx and .d.ts files count as inputs. JavaScript joins the program only when allowJs is on, and .json only with resolveJsonModule. A folder can be full of code, match your include pattern perfectly, and still produce TS18003 because none of it is a file extension the compiler accepts. If you omit include entirely, TypeScript uses **/* and excludes node_modules, bower_components, jspm_packages and your outDir — which is why the quoted exclude often names a folder you never wrote down.

TS18003 has behaved this way since TypeScript 2.1 and the wording has not changed since. Its close neighbour TS18002 — "The 'files' list in config file 'X' is empty" — fires instead when you explicitly write "files": [], which is the deliberate way to mark a config that exists only to be extended.

Common Causes

1. The include Path Points at a Folder That Is Not There

By far the most common trigger: the config was copied from a template or another package, and it names a source folder this project does not use. The pattern is valid, the glob simply matches nothing.

// ❌ Broken — the code lives in app/, the config looks in src/
{
  "compilerOptions": {
    "strict": true,
    "target": "es2022",
    "module": "esnext"
  },
  "include": ["src/**/*"]
}
error TS18003: No inputs were found in config file '/project/tsconfig.json'.
  Specified 'include' paths were '["src/**/*"]' and 'exclude' paths were '[]'.
// ✅ Fixed — point include at the folder that actually holds the sources
{
  "compilerOptions": {
    "strict": true,
    "target": "es2022",
    "module": "esnext"
  },
  "include": ["app/**/*"]
}

Remember that every path inside a config is resolved relative to that config file, not to your shell. A config in packages/api/tsconfig.json with "include": ["packages/api/src"] looks for packages/api/packages/api/src and finds nothing. The same trap bites configs that use extends: patterns written in the base file resolve against the base file's directory, so a shared tsconfig.base.json kept in a config/ folder should usually declare compilerOptions only and leave include to each project.

2. The Project Has No TypeScript Files Yet

A brand-new folder containing a tsconfig.json and nothing else produces TS18003 immediately — most visibly in VS Code, which underlines the config file itself before you have written a line of code.

// ❌ Broken — valid config, empty project
{
  "compilerOptions": {
    "strict": true,
    "target": "es2022",
    "outDir": "dist"
  }
}
error TS18003: No inputs were found in config file '/project/tsconfig.json'.
  Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["dist"]'.
// ✅ Fixed — create the first source file: src/index.ts
export const APP_NAME = "orders-api"

Note what the error quotes here: an include of **/* and an exclude of ["dist"], neither of which appears in the config. Those are the defaults, and dist is on the exclude list purely because it is the outDir. This is the one case where TS18003 is not a mistake — the config is correct and the project is simply empty. Nothing needs fixing beyond writing the code. A folder holding only .d.ts files is a genuine program, by the way, and does not trigger the error.

3. The Sources Are JavaScript and allowJs Is Off

A JavaScript project that is being migrated to TypeScript hits this on day one. The include pattern matches the files, the compiler discards every one of them for having the wrong extension, and the file list comes out empty.

// ❌ Broken — src/ contains only .js files, allowJs is off
{
  "compilerOptions": {
    "strict": true,
    "target": "es2022",
    "module": "esnext"
  },
  "include": ["src"]
}
error TS18003: No inputs were found in config file '/project/tsconfig.json'.
  Specified 'include' paths were '["src"]' and 'exclude' paths were '[]'.
// ✅ Fixed — let the compiler accept .js, and check it too if you want
{
  "compilerOptions": {
    "strict": true,
    "target": "es2022",
    "module": "esnext",
    "allowJs": true,
    "checkJs": true
  },
  "include": ["src"]
}

allowJs alone is enough to make the error go away; checkJs is the follow-up switch that turns those files into something the compiler actually inspects. If the goal is a full migration rather than a mixed codebase, renaming one file to .ts fixes TS18003 just as well and starts the conversion. A related diagnostic waits on the other side of this one: TS6504 — "File 'X' is a JavaScript file. Did you mean to enable the 'allowJs' option?" — is what you get when a .js file is pulled in by an import instead of by include.

4. An exclude Pattern Swallows Every Input

exclude is applied after include, so a pattern that is broader than you intended removes files the include had already matched. The classic version is a stray **/* added while trying to ignore one directory.

// ❌ Broken — the second exclude pattern removes everything include matched
{
  "compilerOptions": {
    "strict": true,
    "target": "es2022"
  },
  "include": ["src/**/*"],
  "exclude": ["**/*.test.ts", "**/*"]
}
error TS18003: No inputs were found in config file '/project/tsconfig.json'.
  Specified 'include' paths were '["src/**/*"]' and 'exclude' paths were '["**/*.test.ts","**/*"]'.
// ✅ Fixed — exclude only the tests, not the whole tree
{
  "compilerOptions": {
    "strict": true,
    "target": "es2022"
  },
  "include": ["src/**/*"],
  "exclude": ["**/*.test.ts"]
}

The CI and Docker variant of this cause looks identical in the log but has nothing to do with the config: the sources never arrived. A COPY package*.json ./ followed by RUN npx tsc builds an image where src does not exist, and a .dockerignore entry can remove it even when the COPY instruction names it. Vite's tsconfig.node.json is another instance — it ships with "include": ["vite.config.ts"], so renaming or deleting that one file turns the config into an empty program and the editor reports TS18003 against it.

How to Fix It

  1. Read the three quoted values in the message before editing anything. The config path tells you which config produced the empty program — in a monorepo that is often not the one you were looking at. The include and exclude arrays tell you exactly what was searched and what was discarded. Comparing those two patterns against your folder layout identifies the cause in most cases without any further investigation.

  2. Make the compiler show you what it matches with tsc -p tsconfig.json --listFilesOnly. This prints every file that ends up in the program and nothing else, so you can widen include one pattern at a time and watch your sources appear. It is far more reliable than reasoning about globs, and it keeps working after the error is fixed as a way to check that tests, .d.ts files and generated code are in or out as intended.

  3. Fix the pattern, remembering that config paths are relative to the config file. Point include at the real source folder, strip a redundant leading path segment in a nested package config, and keep include in the leaf config rather than in a shared base that extends pulls in from another directory. If the project is JavaScript, add allowJs instead of rewriting the patterns.

  4. When only CI or Docker fails, fix the build context rather than the config. A config that works locally and reports TS18003 in a container means the sources are not in the image. Copy the source folder before the compile step, check .dockerignore for a pattern that removes it, and add a temporary ls -la src before tsc so the failing job answers the question itself instead of leaving you to guess.

  5. Do not silence it with an empty "files": [] or by deleting the config. "files": [] swaps TS18003 for TS18002 and is only correct for a base config that exists to be extended and never compiled directly. Deleting the config makes tsc file.ts work but throws away every option you set, including strict. Keep the config, fix the paths, and commit a layout where include names a folder that is guaranteed to exist — then the error cannot come back on a fresh clone.

FAQ

What causes TypeScript error TS18003?

The compiler read your tsconfig.json, applied files, include and exclude, and was left with zero input files. Since TypeScript will not run on an empty program, it stops and quotes the config path plus the two pattern lists it used. Four causes cover nearly every report: an include pattern naming a folder that does not exist or that is spelled relative to the wrong directory, a project whose sources are .js while allowJs is off, an exclude pattern broad enough to remove everything include matched, and a CI or Docker build where the source folder was never copied into the build context. None of them involve your TypeScript code, which is why the error has no file or line number attached.

How do I fix TS18003 when my project only contains JavaScript files?

Add "allowJs": true to compilerOptions. Only .ts, .tsx and .d.ts are treated as inputs by default, so a src folder of .js files matches "include": ["src"] and is then discarded for having the wrong extension — the glob was never the problem. With allowJs the files enter the program; add "checkJs": true if you also want them type checked, which is the usual first step of a gradual migration. If the project is meant to end up fully TypeScript, renaming a single file to .ts resolves the error equally well and starts the conversion. Watch for TS6504 afterwards: it is the same allowJs question asked about a file that arrived through an import rather than through include.

Why does VS Code show TS18003 in an empty project?

Because the config is valid and the project really is empty. With no include key, TypeScript uses a default of **/*, finds no .ts files in a fresh folder, and reports an empty program — and since there is no source file to attach the error to, the editor underlines tsconfig.json itself. Create src/index.ts with any exported value and the error clears on the next check. If source files already exist and the squiggle stays, the editor's language service is holding a stale file list: run TypeScript: Restart TS Server from the command palette, which is also the fix when the error appears right after you create the folder the include pattern names.

Related Errors

Practice This

Browse all TypeScript practice challenges to keep sharpening your type-level skills.

Share this reference

Become a TypeScript Pro

Track your progress through 200+ hands-on challenges. Free, sign in with GitHub.

Or start solving right away: explore all TypeScript challenges