D
Deno

help

npm:axios not returning anything

Aarthemium8/10/2023
I'm trying to troubleshoot a problem with axios (the same snippet works fine on node). I'm calling axios.request , however, it doesn't return anything and doesn't throw any errors. The sequence only get's to print axios request, however, doesn't progress further. importing axios 1.4.0
try {
console.log("axios request");
const axiosRes = await axios.request({
url: `${this.baseUri}/${path}${
options.searchParams ? `?${options.searchParams.toString()}` : ''
}`,
headers: this.headers.concat(options.headers || {}),
method: options.method,
onUploadProgress: options.onUploadProgress,
data: options.body,
});
console.log("AXIOS RESPONSE")
console.log(axiosRes)
return {
headers: axiosRes.headers as any,
body: JSON.stringify(axiosRes.data),
};
} catch (error: any) {
console.log("ERRROOROR")
const axiosError = error as AxiosError;
throw new ApiVideoError(
axiosError.response?.status || 0,
axiosError.response?.data as ProblemDetails
);
}
}
try {
console.log("axios request");
const axiosRes = await axios.request({
url: `${this.baseUri}/${path}${
options.searchParams ? `?${options.searchParams.toString()}` : ''
}`,
headers: this.headers.concat(options.headers || {}),
method: options.method,
onUploadProgress: options.onUploadProgress,
data: options.body,
});
console.log("AXIOS RESPONSE")
console.log(axiosRes)
return {
headers: axiosRes.headers as any,
body: JSON.stringify(axiosRes.data),
};
} catch (error: any) {
console.log("ERRROOROR")
const axiosError = error as AxiosError;
throw new ApiVideoError(
axiosError.response?.status || 0,
axiosError.response?.data as ProblemDetails
);
}
}
Mmarvinh.8/10/2023
That sounds like an issue in deno's node compat layer. Can you file an issue here? https://github.com/denoland/deno/issues

Looking for more? Join the community!