How to fix Argument type 'never' is not compatible with parameter type in TypeScript

TypeScriptADVANCEDMEDIUMUpdated Dec 8, 2025· 108 views

This TypeScript error occurs when TypeScript infers a type as 'never' (representing an impossible or unreachable state) and attempts to use it where it's incompatible with a function parameter. The 'never' type is assignable to all other types, but attempting to pass 'never' to a parameter that expects a specific type can indicate a logic error. The fix involves understanding why TypeScript inferred 'never' and restructuring type constraints or narrowing logic.

Quick fix

Fixes Argument type 'never' is not compatible with parameter type

// Example: Narrowing exhausts all union types
type Status = "success" | "error";

function handle(status: Status) {
  if (status === "success") {
    console.log("Success");
  } else if (status === "error") {
    console.log("Error");
  } else {
    // At this point, status has type 'never'
    const impossible: never = status; // This is correct
  }
}

function process(value: never) {
  // This function can never be called with a real value
}

const x: never = /* impossible to create */;
process(x); // Error: Argument of type 'never' is not compatible
  1. Identify where TypeScript inferred 'never'
  2. Examine the type narrowing logic
  3. Review generic type constraints
  4. Fix incompatible function signatures
typescript — error
// Example: Narrowing exhausts all union types
type Status = "success" | "error";
function handle(status: Status) {
if (status === "success") {
console.log("Success");
} else if (status === "error") {
console.log("Error");
} else {
// At this point, status has type 'never'
const impossible: never = status; // This is correct
}
}
function process(value: never) {
// This function can never be called with a real value
}
const x: never = /* impossible to create */;
process(x); // Error: Argument of type 'never' is not compatible
Argument type 'never' is not compatible with parameter type

What this error means

TypeScript infers the 'never' type when it determines that a value or expression can never occur—it represents an impossible state. When this occurs in a context where a function parameter expects a concrete type, you have a compatibility mismatch. The 'never' type is the bottom type in TypeScript's type system, meaning no other type (except never itself) can be assigned to it. This error typically signals a logical issue in how you've structured union types, type narrowing, or generic type constraints. TypeScript is protecting you from code paths that should never execute.

Typical symptoms

  • TypeScript compiler reports 'Argument of type 'never' is not compatible' error
  • Error appears at function call sites where an argument is inferred as 'never'
  • Type narrowing or switch statements leaving a 'never' case
  • Generic type constraints resolving to an impossible combination
  • Discriminated union handling resulting in 'never' type in some branches

Common causes

  1. Type narrowing has exhausted all possible types, leaving 'never' as the only option
  2. Discriminated union has been narrowed to a case that cannot exist
  3. Generic type parameters have conflicting constraints that result in 'never'
  4. Unhandled or impossible branches in conditional type expressions
  5. Using 'never' explicitly in a function signature but passing non-never values

How to fix "Argument type 'never' is not compatible with parameter type"

1Identify where TypeScript inferred 'never'

Look at the error message to find the exact line and context. The error typically occurs at a function call where an argument has been narrowed or inferred as 'never'.

typescript
// Example: Narrowing exhausts all union types
type Status = "success" | "error";

function handle(status: Status) {
  if (status === "success") {
    console.log("Success");
  } else if (status === "error") {
    console.log("Error");
  } else {
    // At this point, status has type 'never'
    const impossible: never = status; // This is correct
  }
}

function process(value: never) {
  // This function can never be called with a real value
}

const x: never = /* impossible to create */;
process(x); // Error: Argument of type 'never' is not compatible
2Examine the type narrowing logic

Review the conditional branches or type guards that led to the 'never' type. In many cases, the issue is that you've narrowed a union type to exhaustion, and TypeScript correctly identifies that the remaining code path should be unreachable.

typescript
// Example with discriminated union:
type Result = 
  | { status: "success"; data: string }
  | { status: "error"; error: Error };

function handleResult(result: Result) {
  if (result.status === "success") {
    console.log(result.data);
  } else if (result.status === "error") {
    console.log(result.error);
  } else {
    // result has type 'never' here—this is unreachable and correct
    const exhaustive: never = result;
  }
}
3Review generic type constraints

If the error involves generics, check that your type parameters and constraints don't create impossible combinations. Sometimes conflicting constraints can result in 'never'.

typescript
// Example: Impossible generic constraint
function getValue<T extends string & number>(value: T): T {
  // No type can be both string AND number, so T resolves to 'never'
  return value;
}

// Better approach: Use union instead of intersection for multiple possibilities
function getValue<T extends string | number>(value: T): T {
  return value;
}

getValue("hello"); // OK
getValue(42); // OK
4Fix incompatible function signatures

If your function is declared to accept 'never', consider whether this is intentional. A function that accepts only 'never' can never be called with a real value. Change the parameter type to match what you actually need to accept.

typescript
// Before: Function can never be called
function impossible(value: never): void {
  console.log(value);
}

// After: Accept the actual type you need
function possible(value: string | number): void {
  console.log(value);
}

possible("text"); // Now works
possible(42); // Now works
5Use explicit type assertions if exhaustiveness is proven

In cases where you've correctly exhausted all cases and are assigning to a 'never' variable, you can use this as a compile-time exhaustiveness check. This is a valid pattern.

typescript
type Action = "read" | "write" | "delete";

function handleAction(action: Action) {
  if (action === "read") {
    console.log("Reading");
  } else if (action === "write") {
    console.log("Writing");
  } else if (action === "delete") {
    console.log("Deleting");
  } else {
    // Exhaustiveness check: if you add a new Action type,
    // TypeScript will error here because action won't be 'never'
    const exhaustive: never = action;
  }
}
6Compile and verify the fix

Run TypeScript compiler to confirm the error is resolved.

bash
npx tsc --noEmit

If errors remain, revisit your type constraints and narrowing logic to ensure they match your actual usage.

Advanced notes

The 'never' type is a fundamental part of TypeScript's type system and represents the type of values that can never occur. Unlike 'void' (which represents the absence of a value), 'never' represents an impossible value. The key distinction: 'never' is assignable to every type, but no type is assignable to 'never' (except never itself). This makes 'never' useful for exhaustiveness checking in discriminated unions and switch statements. If you encounter 'Argument of type never is not compatible' errors, it's often a signal that your type narrowing is correct and working as intended—TypeScript is protecting you from unreachable code. However, if this appears in production code unexpectedly, it may indicate that your union types, constraints, or function signatures need revision. When working with libraries or complex generic code, understanding how TypeScript resolves type parameters to 'never' is essential for debugging these issues. The 'satisfies' operator (TypeScript 4.9+) can help provide additional type inference hints when 'never' seems to be appearing unexpectedly.

Frequently asked questions

What does "Argument type 'never' is not compatible with parameter type" mean?
TypeScript infers the 'never' type when it determines that a value or expression can never occur—it represents an impossible state. When this occurs in a context where a function parameter expects a concrete type, you have a compatibility mismatch. The 'never' type is the bottom type in TypeScript's type system, meaning no other type (except never itself) can be assigned to it.
How do I fix "Argument type 'never' is not compatible with parameter type"?
This TypeScript error occurs when TypeScript infers a type as 'never' (representing an impossible or unreachable state) and attempts to use it where it's incompatible with a function parameter. The 'never' type is assignable to all other types, but attempting to pass 'never' to a parameter that expects a specific type can indicate a logic error. The fix involves understanding why TypeScript inferred 'never' and restructuring type constraints or narrowing logic.
What causes "Argument type 'never' is not compatible with parameter type"?
Type narrowing has exhausted all possible types, leaving 'never' as the only option Discriminated union has been narrowed to a case that cannot exist Generic type parameters have conflicting constraints that result in 'never'
Is the "Argument type 'never' is not compatible with parameter type" error serious?
It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading