zhaosiyang / axios-observable

Use axios in a rxjs way. use Observable instead of Promise
MIT License
162 stars 19 forks source link

Errors when using Axios 1.x.x #35

Open dbelob opened 1 year ago

dbelob commented 1 year ago

Thank you very much for the excellent library!

Errors occurred while migrating to Axios 1.2.1 with axios-observable 2.0.0

Stackblitz Case (Bug Reports) https://stackblitz.com/github/dbelob/axios-observable-cancel-token-error

Current behavior Error when trying to make HTTP request and error message in console.

In Firefox: image

In Chrome and Edge: image

In Stackblitz: image

Expected behavior Successful completion of the HTTP request, displaying a message in the browser, no error messages in the console: image See example with Axios 0.27.2 https://stackblitz.com/github/dbelob/axios-observable-cancel-token-error/tree/axios-0.27.2

zhaosiyang commented 1 year ago

@dbelob Thanks for your feedback. I can't reproduce the issue that you mentioned. The Stackblitz example just doesn't build.

dbelob commented 1 year ago

@dbelob Thanks for your feedback. I can't reproduce the issue that you mentioned. The Stackblitz example just doesn't build.

Yes, example with axios-observable 2.0.0 and Axios 1.2.1 doesn't build on Stackblitz: https://stackblitz.com/github/dbelob/axios-observable-cancel-token-error (see GitHub repository dbelob/axios-observable-cancel-token-error, branch main) image

But the same example with axios-observable 2.0.0 and Axios 0.27.2 builds and runs successfully on Stackblitz: https://stackblitz.com/github/dbelob/axios-observable-cancel-token-error/tree/axios-0.27.2 (see GitHub repository dbelob/axios-observable-cancel-token-error, branch axios-0.27.2) image

Summary:

Please do these steps on your local computer:

  1. git clone https://github.com/dbelob/axios-observable-cancel-token-error.git
  2. cd axios-observable-cancel-token-error
  3. npm install
  4. npm start

(the browser will open automatically with errors in the console)

zhaosiyang commented 1 year ago

@dbelob This issue is introduced by axios@1.1.3 and it works fine for axios@1.1.2. Let me try to investigate further. Something might have to be changed on axios side. In the mean time, you can revert your axios version to 1.1.2 and I'll submit an issue in axios once I figure out what's going wrong with axios

dbelob commented 1 month ago

@zhaosiyang you have closed an unsolved issue.

Repository https://github.com/dbelob/axios-observable-cancel-token-error changed: Axios updated to latest version (1.7.7)

I checked the example with axios-observable 2.0.0 and Axios 1.7.7:

  1. git clone https://github.com/dbelob/axios-observable-cancel-token-error.git
  2. cd axios-observable-cancel-token-error
  3. npm install
  4. npm start

The browser will open automatically with errors in the console:

In Firefox: image

In Chrome and Edge: image

Same errors.