Question

Understanding TS18003: No Inputs Were Found in tsconfig.json for TypeScript Builds

typescriptjsonvisual-studio-2015asp.net-core

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 files array, 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 exclude removes 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 .ts or .tsx files in the folder covered by tsconfig.json.
  • The tsconfig.json file is placed in a folder that does not contain the source files you expect.
  • Your exclude patterns 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.json helps 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.

  • include says: "Look in these places."
  • exclude says: "Ignore these places."
  • files says: "Use exactly these files."

Now imagine TypeScript as a worker filling a basket with source files:

  1. Start in the folder where tsconfig.json lives.
  2. Collect files that match the include rules.
  3. Throw away files that match the exclude rules.
  4. 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."

Take Quiz

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.ts matches src/**/*.ts
  • src/app.ts is 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

  1. TypeScript starts in the folder containing tsconfig.json.
  2. It reads include: ["**/*.ts"].
  3. It searches for all .ts files under that folder.
  4. It finds:
    • main.ts
    • helpers/math.ts
  5. It applies exclude:
    • node_modules is ignored
    • ../wwwroot/app is ignored
  6. The remaining input files are:
    • main.ts
    • helpers/math.ts
  7. Since input files exist, compilation proceeds.
  8. 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/.

  • include points to src/**/*.ts
  • exclude skips dist and node_modules

ASP.NET Core projects

A project may place TypeScript under Scripts/ and emit JavaScript into wwwroot/.

  • Source: Scripts/**/*.ts
  • Output: wwwroot/app
  • exclude prevents 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.

Take Quiz

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/ or Scripts/ for source
  • dist/ or wwwroot/ 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.ts file, 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

OptionWhat it doesBest used whenCommon risk
filesCompiles only the exact files listedSmall projects or very controlled inputsEasy to forget new files
includeCompiles files matching patternsMost projectsWrong glob pattern can miss files
excludeRemoves matching files/folders from included setIgnoring output and dependenciesCan accidentally exclude all sources
Default include (**/*)Uses automatic discovery when include is omittedSimple setupsLess explicit and harder to debug

include vs files

  • Use include when you want all matching files in a folder structure.
  • Use files when you want exact control.

Example with files:

{
  "files": ["main.ts", "helpers/math.ts"]
}

Implicit vs explicit file matching

StyleExampleAdvantageDisadvantage
Implicitomit includeLess typingHarder to understand
Explicit"include": ["Scripts/**/*.ts"]Clear and maintainableSlightly more setup

For most real projects, explicit include is the safer choice.

Take Quiz

Cheat Sheet

{
  "compilerOptions": {
    "target": "es6",
    "outDir": "dist"
  },
  "include": ["src/**/*.ts"],
  "exclude": ["node_modules", "dist"]
}

Quick rules

  • tsconfig.json paths are relative to the location of tsconfig.json.
  • include chooses candidate files.
  • exclude removes files from that set.
  • files overrides discovery with an exact list.
  • outDir is where compiled output goes, not where source should be read from.
  • TS18003 means the final input file list is empty.

Good defaults

  • Put source in src/ or Scripts/
  • Put output in dist/ or wwwroot/
  • Exclude generated output folders
  • Use explicit include patterns like:
"include": ["src/**/*.ts"]

Common fixes for TS18003

  • Add a .ts file
  • Move tsconfig.json to the correct folder
  • Fix your include glob
  • 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.

Take Quiz

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

  1. Create a src folder with at least two .ts files.
  2. Add a tsconfig.json file in the project root.
  3. Configure TypeScript to compile only files inside src.
  4. Send compiled JavaScript output to dist.
  5. Exclude node_modules and dist from input scanning.
Take Quiz

Keep learning

Related questions

View more