After upgrading axios versions from 0.28 to 1.6.4 our simple axios.get
call throws an error of:
this$1.originalAdapter.call is not a function
The call is never made. There is no network activity.
The axios code is:
async get<T>(url: string, params?: object, configs: AxiosRequestConfig = {headers: {}} as AxiosRequestConfig): Promise<T | void> {
configs = this._appendNewFlagToHeader(configs);
configs.params = params;
console.log("PARAMS "+ JSON.stringify(configs));
return await axios.get(url, configs)
.then((response) => Axios.getResponse<T>(response))
.catch(Axios.catchErrors);
}
The resulting configs object is:
{"headers":{"X-New":true},"params":{"username":"my-username"}}
As far as I can tell the axios call and format of the header and params object is correct.
The imports are:
import {AxiosError, AxiosRequestConfig, AxiosResponse, default as axios} from 'axios';
To add some context the error is likely coming from a yield call outside of axios but changing the axios library leads to the error.
// Get connection from Server
const getAuthenticationConnectionUseCase = new GetAuthenticationConnection(httpProvider, configurations);
const {connection} = yield call({
context: getAuthenticationConnectionUseCase,
fn: getAuthenticationConnectionUseCase.executeAsync
}, {
...payload
} as GetAuthenticationConnectionInput);
Not sure how axios would impact that call
We can rewrite our Axios implementation as needed but I can’t even see what is wrong with the call above