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

0.21.2: Response interceptor not called when request interceptor is attached #4012

Closed
nerdbeere opened this issue Sep 4, 2021 · 19 comments
Closed

Comments

@nerdbeere
Copy link
Contributor

Describe the bug

With the latest release 0.21.2 the response interceptor is no longer called when a request interceptor is attached.

To Reproduce

Not working: https://jsfiddle.net/yedqwjma/

// response interceptor won't be executed
axios.interceptors.response.use((config) => {
	console.log('response interceptor');
  return config;
});

axios.interceptors.request.use((config) => {
	console.log('request interceptor');
  return config;
});

axios.get('https://jsonplaceholder.typicode.com/todos/1');

Working Case with 0.21.1: https://jsfiddle.net/n05rdb49/

Expected behavior

Response interceptor should be executed

Environment

  • Axios Version 0.21.2

Additional context/Screenshots

Not required

@nerdbeere
Copy link
Contributor Author

nerdbeere commented Sep 4, 2021

@jasonsaayman found and fixed the issue and added a test, maybe you could have a look: #4013

@exneval
Copy link

exneval commented Sep 4, 2021

faced the same issue, the response interceptors never get called, need to revert back to 0.21.1

@jadeydi
Copy link

jadeydi commented Sep 4, 2021

faced the same issue

@oneness0
Copy link

oneness0 commented Sep 4, 2021

+1

2 similar comments
@maheshdama13
Copy link

+1

@z0y1
Copy link

z0y1 commented Sep 4, 2021

+1

@vesper8
Copy link

vesper8 commented Sep 4, 2021

+1 This regression just cost me my entire afternoon =/

@bryce0516
Copy link

same here

@lvjiaxuan
Copy link

oh my god,

@jasonsaayman
Copy link
Member

Waiting for the build to pass and then I will release this, thanks @nerdbeere for the fix

@jasonsaayman
Copy link
Member

I have released and tagged a new version. Sorry for the frustration caused, I will work on a plan tomorrow to make release break less and bring some consistency to the release schedule etc.

@ddolcimascolo
Copy link

Hi guys,

Can someone confirm that v0.21.3 fixes the issue? I'm asking because our builds are still failing when upgrading from 0.21.1 to 0.21.3 (and the errors we get are the same as the one we had when trying an upgrade to 0.21.2).

To be honest, I didn't inspect the failures in details yet, but retrying the build reproduces the error, so either:

  • We're hit by this interceptors issue (we do use interceptors) and it's not fixed
  • There's another regression and I can give you more details tomorrow, or Monday morning

Luckily we have tests that caught the regressions in time 😅

Thx,
David

@bryce0516
Copy link

axios 0.21.3 is properly working!

@ddolcimascolo
Copy link

Thx for confirming. I've analyzed my build failures and created #4016

@gfortaine
Copy link
Contributor

@ddolcimascolo It should be fixed with 0.21.4 #4020

@Shajansheriff
Copy link

@nerdbeere Thanks for saving our day!

@zohairkazmi
Copy link

it works with 0.21.4 but fails with 0.24.0. Somebody has put the buggy code back :)

@zohairkazmi
Copy link

it works with 0.23.0 as well but not 0.24.0

@Note45
Copy link

Note45 commented Dec 13, 2021

I have the same issue with Axios version 0.21.2. To fix I updated to version 0.23.0

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