Skip to content

TypeScript TS2380 error in statsig-generated.d.ts (@statsig/statsig-node-core 0.14.1) #60

@ktey-riot

Description

@ktey-riot

Hi Statsig team,

We’re running into a TypeScript compilation error originating from the published typings in @statsig/statsig-node-core version 0.14.1.

Specifically, tsc fails with:

error TS2380: The return type of a 'get' accessor must be assignable to its 'set' accessor type.
Type 'null' is not assignable to type '{ [key: string]: string | undefined; tier?: string | undefined; } | undefined'.

This error points to statsig-generated.d.ts (around line ~66). It looks like there’s a getter returning T | null, while the corresponding setter only accepts T | undefined, which violates TypeScript’s accessor compatibility rules.

This happens when compiling with skipLibCheck: false (which we rely on to catch real typing issues), and the error occurs even without directly referencing the affected API.

We’ve unblocked ourselves for now by applying a local patch to the generated .d.ts, but wanted to flag this in case it’s a regression in the 0.14.x generated typings and should be addressed upstream.

We couldn’t find any public issues or documentation referencing this yet, so sharing in case it’s helpful.

Best,
Kason

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions