TypeScript Compiler Diagnostics

TS2554: Incorrect number of value arguments

A call supplies fewer arguments than the required function parameters. The second parameter is part of the contract. Pass it explicitly; a default or optional parameter is appropriate only when omission is intentionally supported and handled by the implementation. Baseline: TypeScript 5.8.3 with the shown configuration. Reproduce in one directory and create the corrected project in another. The diagnostic can have other causes; inspect its location and message before choosing a correction. Both projects keep strict checking enabled.

Formal Syntax & Structure

typescript syntaxtypescript
TS2554 (compiler diagnostic code, not TypeScript syntax)

Working Example

Example Snippettypescript
// INTENTIONALLY INVALID — reproduce// File: tsconfig.json (omit this label){  "compilerOptions": {    "strict": true,    "target": "ES2022",    "module": "CommonJS",    "types": [],    "lib": [      "ES2022",      "DOM"    ],    "noEmitOnError": true,    "outDir": "dist"  },  "files": [    "main.ts"  ]}
// File: main.ts (omit this label)function area(w:number,h:number) { return w*h; }console.log(area(3));
// Run: tsc -p . --pretty false// Expected: TS2554; no output emitted.
// CORRECTED PROJECT — separate directory// File: tsconfig.json (omit this label){  "compilerOptions": {    "strict": true,    "target": "ES2022",    "module": "CommonJS",    "types": [],    "lib": [      "ES2022",      "DOM"    ],    "noEmitOnError": true,    "outDir": "dist"  },  "files": [    "main.ts"  ]}
// File: main.ts (omit this label)function area(w:number,h:number) { return w*h; }console.log(area(3,4));
// Run: tsc -p . --pretty false// Expected: no diagnostics.// Run: node dist/main.js// Expected stdout: 12
TypeScript Reference