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:
- Build tools depend on predictable file discovery.
- A valid
tsconfig.jsonhelps editors, bundlers, and CI systems all compile the same files. - Incorrect file matching can break builds even when your code itself is fine.
In the question above, the key clue is this part of the error:
Specified 'include' paths were '["**/*"]'
That tells us TypeScript is using the default include behavior, meaning it is scanning from the folder containing tsconfig.json. If it still finds no inputs, there are likely no .ts files there, or they are all excluded.
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/
tsconfig.json:
{
"compilerOptions": {
"target": "es6",
"outDir": "dist"
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules", "dist"]
}
src/app.ts:
const message: string = "Hello TypeScript";
console.log(message);
This works because:
src/app.tsmatchessrc/**/*.tssrc/app.tsis not excluded- TypeScript has at least one input file
Example 2: A config that causes TS18003
{
"compilerOptions": {
"outDir": "dist"
},
"exclude": ["src", "node_modules", "dist"]
}
If your TypeScript files are inside src, this excludes all of them. Result: no inputs found.
Example 3: Fixing the original kind of problem
If your .ts files are in the same folder as tsconfig.json or a child folder like app, you can make it explicit:
{
"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"
},
"include": ["**/*.ts"],
"exclude": ["../wwwroot/app", "node_modules"]
}
This makes your intent clearer: compile TypeScript files, not every possible file.
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.tshelpers/math.ts
- It applies
exclude:node_modulesis ignored../wwwroot/appis ignored
- The remaining input files are:
main.tshelpers/math.ts
- Since input files exist, compilation proceeds.
- JavaScript output is written to
../wwwroot/app.
What would trigger TS18003 here?
If main.ts and helpers/math.ts did not exist, then after scanning there would be zero matching .ts files, and TypeScript would report:
No inputs were found in config file
Important detail
The default include behavior often looks like **/*, but TypeScript still only treats supported source files as inputs. If none are present, the build fails.
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:
- source files were not committed
- paths differ by environment
- the config relies on defaults that are not clear
Template or starter projects
Sometimes a project contains tsconfig.json before any .ts files are added. In that case, the build fails until at least one TypeScript file exists or the TypeScript build step is removed.
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 - remove TypeScript build integration until TypeScript is actually used
Common pattern: validation through CI
Build systems run tsc --project tsconfig.json to ensure:
- paths are correct
- source files exist
- generated files are not being used as inputs
Common pattern: excluding build folders
Folders such as dist, build, wwwroot, bin, and obj are often excluded because they contain generated output.
Common pattern: avoid wildcard confusion
Instead of relying on implicit **/*, teams prefer focused patterns such as:
{
"include": ["src/**/*.ts", "src/**/*.tsx"]
}
This is easier to understand and maintain.
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:
{
"include": ["src/**/*.ts"],
"exclude": ["src"]
}
This removes all source files.
Fix: do not exclude the folder that contains your source files.
4. Using broad defaults and assuming they work
If you omit include, TypeScript uses defaults. That can be fine, but it is less clear.
Fix: specify include explicitly.
5. Confusing output files with input files
A folder like ../wwwroot/app is usually the output folder, not the source folder.
Fix: keep output excluded and make sure real source files are elsewhere.
6. Wrong glob expectations
Broken expectation:
{
"include": ["**/*"]
}
This does not mean every file becomes a TypeScript source file. TypeScript still looks for supported file types.
Fix: use explicit patterns like **/*.ts.
7. Forgetting that IDE upgrades can change behavior
A Visual Studio or TypeScript update may enforce config validation more strictly.
Fix: review the config and make source file matching explicit.
Likely fix for the original situation
If your TypeScript files live under the same Scripts folder, use something like:
{
"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"
},
"include": ["**/*.ts"],
"exclude": ["../wwwroot/app", "node_modules"]
}
If there are still no .ts files in that folder tree, the build error is expected.
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 |
include vs files
- Use
includewhen you want all matching files in a folder structure. - Use
fileswhen you want exact control.
Example with files:
{
"files": ["main.ts", "helpers/math.ts"]
}
Implicit vs explicit file matching
| Style | Example | Advantage | Disadvantage |
|---|---|---|---|
| Implicit | omit include | Less typing | Harder to understand |
| Explicit | "include": ["Scripts/**/*.ts"] | Clear and maintainable | Slightly more setup |
For most real projects, explicit include is the safer choice.
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.
Good defaults
- Put source in
src/orScripts/ - Put output in
dist/orwwwroot/ - Exclude generated output folders
- Use explicit include patterns like:
"include": ["src/**/*.ts"]
Common fixes for TS18003
- Add a
.tsfile - Move
tsconfig.jsonto the correct folder - Fix your
includeglob - Stop excluding your source folder
- Remove TypeScript build integration if the project no longer uses TypeScript
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.
What if my project has no TypeScript files yet?
Either add a starter .ts file or remove the TypeScript build step until you actually need it.
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.
Accessing Input Value from EventTarget in TypeScript
Learn why EventTarget has no value property in TypeScript and safely read values from HTML input events in Angular applications.
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.