-
Notifications
You must be signed in to change notification settings - Fork 62
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
retry-axios doesn't work with latest axios release v1.1.3 #205
Comments
Same issue here @JustinBeckwith It would be nice to know if/when you are planning to fix this and/or if you have any hints for us of what this bug could be. |
👋 no plan at the moment to fix this, but happy to review pull requests |
+1 |
Seems known Axios bug, see axios/axios#5089. The following line could fix the problem, which needs to placed before retrying the request. //TODO: To be removed when https://github.com/axios/axios/issues/5089 gets closed.
err.config!.headers = JSON.parse(JSON.stringify(err.config?.headers || {})) As client/user of const retryConfig: RetryConfig = {
retry: 3,
retryDelay: 1000,
httpMethodsToRetry: ['GET'],
statusCodesToRetry: [[404,500]],
onRetryAttempt: err => {
//TODO: To be removed when https://github.com/axios/axios/issues/5089 gets closed.
err.config!.headers = JSON.parse(JSON.stringify(err.config?.headers || {}))
}
}; |
I have a project that uses
retry-axios
withaxios v0.27.2
. It has been upgraded toaxios v1.1.3
and the retries simply stopped working - it looks to me that the retries are somehow cached and the response is not being updated from the server. Downgrading to the previousv0.27.2
release solved the problem.This is roughly how the code is structured:
Possibly relates to #201
The text was updated successfully, but these errors were encountered: