data icon indicating copy to clipboard operation
data copied to clipboard

"Type instantiation is excessively deep and possibly infinite" error on drop when typescript is set to strict: false

Open Tim-Gaud opened this issue 1 year ago • 0 comments

I'm getting "Type instantiation is excessively deep and possibly infinite" error when calling drop. This error is only present when tsconfig has strict set to false. Changing the type signature of the drop function will also remove the error e.g.

export function drop<T extends Record<string, any> = any>(factoryApi: FactoryAPI<T>): void {

reproduction: https://codesandbox.io/p/sandbox/msw-data-type-issue-6d29pf

dependencies:

    "@mswjs/data": "0.16.2",
    "@faker-js/faker": "8.0.1",
    "typescript": "5.1.6"

Tim-Gaud avatar Dec 02 '24 12:12 Tim-Gaud