Skip to content
Latchkey

TS2349: This expression is not callable - in CI

You invoked a value that the compiler does not consider a function.

What this error means

Type-checking fails with TS2349 stating the type has no call signatures, often on a union or a default-import mishap.

tsc
src/run.ts(14,3): error TS2349: This expression is not callable. Type 'Number' has no call signatures.

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

Call the right value

  1. Narrow a union so only the callable member is invoked
  2. For interop modules, enable esModuleInterop or import * as
tsconfig.json
{
  "compilerOptions": { "esModuleInterop": true }
}

Fix the type if it is wrong

  1. Correct the declaration so the value has a call signature

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

  • Enable esModuleInterop for CommonJS interop and narrow unions before calling.

Frequently asked questions

How do I fix TS2349: this expression is not callable?
There are 2 fixes depending on which cause you have: call the right value and fix the type if it is wrong. Work through them in order, since the first is the most common.
What does TS2349: this expression is not callable actually mean?
Type-checking fails with TS2349 stating the type has no call signatures, often on a union or a default-import mishap.
How do I stop TS2349: this expression is not callable happening again?
Enable esModuleInterop for CommonJS interop and narrow unions before calling.

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