Skip to content

Timeout not throwing error with status TIMEOUT_ERRORΒ #2915

@PopJoestar

Description

@PopJoestar

Hey, PR #2401 shows that fetchBaseQuery should throw a TIMEOUT_ERROR when time out delay is reached. However, I got an error without status {"message": "Aborted", "name": "AbortError"}. I'm using
"@reduxjs/toolkit": "^1.9.0" with "react-native": "0.70.3", "react": "18.1.0". Here is my base API:

export const BaseApi = createApi({
  reducerPath: 'baseApi',
  baseQuery: fetchBaseQuery({
    baseUrl: Config.BASE_URL,
    prepareHeaders: headers => {
      const token = Preferences.getToken();
      headers.set('authorization', `Bearer ${token}`);

      return headers;
    },
    timeout: 1,
  }),
  tagTypes: ['Auth', 'Notification', 'Restaurant'],
  endpoints: () => ({}),
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions