Question
Understanding TS18003: No Inputs Were Found in tsconfig.json for TypeScript Builds
Question
I have an ASP.NET Core project, and when I try to build it I get this TypeScript error:
error TS18003: Build: No inputs were found in config file 'Z:/Projects/client/ZV/src/ZV/Scripts/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["../wwwroot/app","node_modules/*"]'.
The command exited with code 1.
Done executing task "VsTsc" -- FAILED.
My tsconfig.json file is:
{
"compileOnSave": true,
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es5", "dom"],
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
"noImplicitAny": false,
"outDir": "../wwwroot/app/",
"removeComments": false,
"sourceMap": true,
"target": "es6"
},
"exclude": [
"../wwwroot/app",
"node_modules/*"
]
}
Am I doing something wrong, or is this a bug? I recently upgraded Visual Studio 2015 to Update 3, so I am wondering whether that could be related.
Short Answer
By the end of this page, you will understand what the TypeScript error TS18003: No inputs were found in config file means, how tsconfig.json decides which files to compile, and how to fix this problem by correctly using include, exclude, and project file locations.
Concept
TS18003 means the TypeScript compiler looked at your tsconfig.json and could not find any TypeScript input files to compile.
TypeScript does not compile a project by guessing randomly. It builds a list of input files using these rules:
- If you use a
filesarray, only those files are compiled. - If you use
include, matching files are compiled. - If you use neither, TypeScript uses default include patterns such as
**/*. - Then
excluderemoves matching paths from that set.
If the final result contains zero TypeScript source files, the compiler reports TS18003.
In practice, this usually happens for one of these reasons:
- There are no
.tsor.tsxfiles in the folder covered bytsconfig.json. - The
tsconfig.jsonfile is placed in a folder that does not contain the source files you expect. - Your
excludepatterns remove everything. - Your source files were moved, renamed, or generated elsewhere.
- Build tooling changed after an IDE or compiler update and now validates the config more strictly.
Why this matters:
Mental Model
Think of tsconfig.json as a file filter for a folder.
includesays: "Look in these places."excludesays: "Ignore these places."filessays: "Use exactly these files."
Now imagine TypeScript as a worker filling a basket with source files:
- Start in the folder where
tsconfig.jsonlives. - Collect files that match the include rules.
- Throw away files that match the exclude rules.
- Compile what remains.
If the basket ends up empty, you get TS18003.
So the error does not usually mean TypeScript itself is broken. It usually means: "I followed your file selection rules, and there was nothing to compile."
Syntax and Examples
The main tsconfig.json properties related to this error are:
{
"include": ["src/**/*.ts"],
"exclude": ["node_modules", "dist"],
"compilerOptions": {
"outDir": "dist",
"target": "es6"
}
}
What each part means
include: where TypeScript should look for input files.exclude: paths to skip.compilerOptions.outDir: where compiled JavaScript should go.
Example 1: A working setup
Project structure:
project/
tsconfig.json
src/
app.ts
dist/
Step by Step Execution
Consider this small project:
Scripts/
tsconfig.json
main.ts
helpers/
math.ts
node_modules/
../wwwroot/app/
tsconfig.json:
{
"include": ["**/*.ts"],
"exclude": ["../wwwroot/app", "node_modules"],
"compilerOptions": {
"outDir": "../wwwroot/app"
}
}
Step-by-step
- TypeScript starts in the folder containing
tsconfig.json. - It reads
include: ["**/*.ts"]. - It searches for all
.tsfiles under that folder. - It finds:
main.ts
Real World Use Cases
This concept shows up often in real projects:
Frontend apps
A web app may keep source files in src/ and compiled files in dist/.
includepoints tosrc/**/*.tsexcludeskipsdistandnode_modules
ASP.NET Core projects
A project may place TypeScript under Scripts/ and emit JavaScript into wwwroot/.
- Source:
Scripts/**/*.ts - Output:
wwwroot/app excludeprevents TypeScript from re-reading generated output
Monorepos
Multiple apps may each have their own tsconfig.json.
- Each config needs the correct folder scope
- A misplaced config can accidentally point to no files
Build pipelines and CI
A local IDE might appear fine, but CI can fail if:
Real Codebase Usage
In real projects, developers usually make file matching explicit instead of relying on defaults.
Common pattern: explicit include
{
"include": ["Scripts/**/*.ts"],
"exclude": ["node_modules", "wwwroot", "bin", "obj"]
}
This avoids confusion when the project grows.
Common pattern: keep source and output separate
Developers often structure projects like this:
src/orScripts/for sourcedist/orwwwroot/for compiled output
This prevents accidental re-compilation of generated files.
Common pattern: guard against empty configs
When setting up a project, teams often either:
- add a starter
index.tsfile, or
Common Mistakes
Here are the most common causes of TS18003.
1. No .ts files exist
Broken setup:
{
"compilerOptions": {
"outDir": "dist"
}
}
If the project has no TypeScript files yet, the compiler has nothing to build.
Fix: add at least one .ts file or remove the TypeScript build step.
2. tsconfig.json is in the wrong folder
If tsconfig.json is inside Scripts/, TypeScript searches relative to Scripts/, not the project root.
Fix: either move tsconfig.json or use correct relative include paths.
3. Excluding your source folder
Broken config:
Comparisons
| Option | What it does | Best used when | Common risk |
|---|---|---|---|
files | Compiles only the exact files listed | Small projects or very controlled inputs | Easy to forget new files |
include | Compiles files matching patterns | Most projects | Wrong glob pattern can miss files |
exclude | Removes matching files/folders from included set | Ignoring output and dependencies | Can accidentally exclude all sources |
Default include (**/*) | Uses automatic discovery when include is omitted | Simple setups | Less explicit and harder to debug |
vs
Cheat Sheet
{
"compilerOptions": {
"target": "es6",
"outDir": "dist"
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules", "dist"]
}
Quick rules
tsconfig.jsonpaths are relative to the location oftsconfig.json.includechooses candidate files.excluderemoves files from that set.filesoverrides discovery with an exact list.outDiris where compiled output goes, not where source should be read from.TS18003means the final input file list is empty.
FAQ
Why does TypeScript say no inputs were found?
Because after applying include, exclude, and default rules, the compiler found zero TypeScript source files.
Does outDir affect which files are compiled?
No. outDir controls where compiled JavaScript is written. It does not define source inputs.
Is TS18003 a TypeScript bug?
Usually no. It normally means the config points to no valid input files.
Can upgrading Visual Studio cause this error to appear?
Yes. An upgrade can surface configuration problems that were previously ignored or handled differently.
Should I use include explicitly?
Yes, in most projects it is clearer and easier to maintain than relying on defaults.
What should I include for an ASP.NET Core project?
Usually the folder that contains your .ts files, such as Scripts/**/*.ts or ClientApp/src/**/*.ts.
Why exclude wwwroot or dist?
Those folders often contain generated JavaScript output. Excluding them prevents TypeScript from treating generated files as source inputs.
Mini Project
Description
Create a small TypeScript project that compiles files from a source folder into an output folder without triggering TS18003. This project demonstrates how include, exclude, and outDir work together in a realistic setup.
Goal
Set up a working TypeScript build that compiles .ts files from src/ into dist/ using a correct tsconfig.json.
Requirements
- Create a
srcfolder with at least two.tsfiles. - Add a
tsconfig.jsonfile in the project root. - Configure TypeScript to compile only files inside
src. - Send compiled JavaScript output to
dist. - Exclude
node_modulesanddistfrom input scanning.
Keep learning
Related questions
@Directive vs @Component in Angular: Differences, Use Cases, and When to Use Each
Learn the difference between @Directive and @Component in Angular, including use cases, examples, and when to choose each.
Angular (change) vs (ngModelChange): What’s the Difference?
Learn the difference between Angular (change) and (ngModelChange), when each fires, and which one to use in forms and inputs.
Angular Dependency Injection: Fix "Can't Resolve All Parameters for Component" Errors
Learn why Angular shows "Can't resolve all parameters for component" and how to fix service injection issues in components.