#1230·immer

WritableDraft flattens variadic tuples into plain arrays, losing tuple structure

Author: aovchinnCreated Apr 10, 2026Updated Aug 11, 2026

Bug Report

after 11.0.0 -> 11.1.4 bump, typescript types changed, build is not passing

To Reproduce

typescript
import {produce} from "immer"

interface State {
    foo: [boolean, ...number[]];
}

produce<State>(x => foo(x));

const foo = (x: State) => x;

Observed behavior

Argument of type 'WritableNonArrayDraft<State>' is not assignable to parameter of type 'State'.
  Types of property 'foo' are incompatible.
    Type '(number | boolean)[]' is not assignable to type '[boolean, ...number[]]'.

Expected behavior

should work as in 11.0.0, seems like a slightly breaking change

Environment

  • Immer version:
  • I filed this report against the latest version of Immer