Skip to content
Latchkey

TS6053: File not found - in CI

tsc was told to compile a specific file that does not exist at the given path.

What this error means

tsc fails with TS6053 naming a path from the files array, an extends, or a reference that is missing.

tsc
error TS6053: File '/app/src/main.ts' not found.

Diagnose it: which tsconfig and which compiler?

A TypeScript error that appears only in CI usually means the runner is compiling with a different config or a different compiler version than your editor. Your editor uses the workspace TypeScript and the nearest tsconfig.json; CI uses whatever the lockfile resolved and whatever config the build script names.

Terminal
# what CI will actually use
npx tsc --version
npx tsc --showConfig | head -40

# which files are in the program (a missing include is a common cause)
npx tsc --listFiles | wc -l

# type-check only, no emit, same as most CI gates
npx tsc --noEmit

Common causes

How to fix it

Fix the path in tsconfig

  1. Update the files entry to the real path with exact casing
tsconfig.json
{
  "files": ["src/main.ts"]
}

Ensure the file is present in CI

  1. Confirm the checkout includes the path; avoid sparse checkouts that drop it
shell
ls -la src/main.ts

Pin the compiler so unrelated updates cannot break the gate

TypeScript adds errors in minor releases. An unpinned compiler turns a routine dependency update into a red build on code nobody touched, which is the most common false alarm in a TypeScript CI pipeline.

package.json
// package.json
{
  "devDependencies": {
    "typescript": "5.6.3"   // exact, not ^5.6.3
  }
}

How to prevent it

  • Keep tsconfig files entries current and verify CI checks out all referenced source paths.

Frequently asked questions

How do I fix TS6053: file not found?
There are 2 fixes depending on which cause you have: fix the path in tsconfig and ensure the file is present in ci. Work through them in order, since the first is the most common.
What does TS6053: file not found actually mean?
tsc fails with TS6053 naming a path from the files array, an extends, or a reference that is missing.
How do I stop TS6053: file not found happening again?
Keep tsconfig files entries current and verify CI checks out all referenced source paths.

Related guides

References

Not every red build is your code. Latchkey repairs the ones that are not, on the runner. Start free → 30-day trial · No credit card