1

I am having trouble with Typescript and Redux Toolkit. My code seems to be ok, but I am getting this error:

/home/mp/JsProjects/myproject/node_modules/@reduxjs/toolkit/src/createAsyncThunk.ts
TypeScript error in /home/mp/JsProjects/myproject/node_modules/@reduxjs/toolkit/src/createAsyncThunk.ts(508,11):
Property 'abort' is missing in type '{ aborted: false; addEventListener(): void; dispatchEvent(): false; onabort(this: AbortSignal): void; removeEventListener(): void; }' but required in type 'AbortSignal'.  TS2741

    506 |       ? AbortController
    507 |       : class implements AbortController {
  > 508 |           signal: AbortSignal = {
        |           ^
    509 |             aborted: false,
    510 |             addEventListener() {},
    511 |             dispatchEvent() {

I'm using:

  • @redux-toolkit v1.6.1
  • node v16.4.1

I realize this is a typing file from the npm module. How do I go about fixing this?

Peter Molnar
  • 123
  • 2
  • 7

0 Answers0