Skip to content

Investigate createAsyncThunk type failures with TS 5.1+ #3758

Closed

Description

Bumped the TS versions to include 5.1 and 5.2, and got this:

https://github.com/reduxjs/redux-toolkit/actions/runs/6367491100/job/17286119923?pr=3757

Run yarn tsc --version
Version 5.1.6
Error: src/tests/createAsyncThunk.typetest.ts(294,39): error TS2345: Argument of type 'AsyncThunk<number, number, AsyncThunkConfig>' is not assignable to parameter of type '(arg?: number | undefined) => any'.
  Types of parameters 'arg' and 'arg' are incompatible.
    Type 'number | undefined' is not assignable to type 'number'.
      Type 'undefined' is not assignable to type 'number'.
Error: src/tests/createAsyncThunk.typetest.ts(295,5): error TS2554: Expected 1 arguments, but got 0.
Error: Process completed with exit code 2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions