Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error TypeError: axios.isCancel is not a function #318

Open
emanu7478 opened this issue Sep 6, 2023 · 1 comment
Open

error TypeError: axios.isCancel is not a function #318

emanu7478 opened this issue Sep 6, 2023 · 1 comment

Comments

@emanu7478
Copy link

emanu7478 commented Sep 6, 2023

const axiosApiInstance = axios.create({ baseURL: "YOUR_BASE_URL_HERE" });

const apisauceInstance = create({
  axiosInstance: axiosApiInstance,
  baseURL: "YOUR_BASE_URL_HERE",
});

try {
    const response: ApiResponse<T> = await apisauceInstance.post(
      endpoints[endpointKey],
      requestData
    );
    return response;
  } catch (error: any) {
    throw error;
  }

When I tried the above code it showed the below error

Screenshot 2023-09-06 at 11 35 20 AM

Versions using are "axios": "^1.5.0" and "apisauce": "^3.0.1"

@jamonholmgren
Copy link
Member

Can you provide a codesandbox? I wasn't able to replicate.

https://codesandbox.io/s/nervous-perlman-whs2t8?file=/src/index.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants