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

Why axios return error ETIMEDOUT but when I do cURL it's running fine? #6397

Closed
hashfi-motion opened this issue May 17, 2024 · 3 comments
Closed

Comments

@hashfi-motion
Copy link

hashfi-motion commented May 17, 2024

Describe the issue

As the title said, when I do the request with cURL on my terminal it's working fine, but when in my Axios it timed out. Why? For more context, this request is to my Telegram bot API.

Example Code

public async getMe(): Promise<_types.Telegram.User> {
	let response: AxiosResponse<_types.Telegram.User>;
	let output: _types.Telegram.User;

	try {
		const url = this.baseURL + '/getMe';
		response = await axios.get<_types.Telegram.User>(url, { timeout: 1000000000 });
	} catch (error) {
		throw error;
	}

	output = response.data;
	return output;
}

Expected behavior

Running fine without error time out.

Axios Version

1.6.7

Adapter Version

No response

Browser

No response

Browser Version

No response

Node.js Version

20.10.0

OS

Debian GNU/Linux 10 (buster)

Additional Library Versions

No response

Additional context/Screenshots

No response

@Ali-Bhatti
Copy link

I am also facing the same issue

@Vilya2
Copy link

Vilya2 commented May 29, 2024

Me too

@hashfi-motion
Copy link
Author

For anyone still having same issue with me, double-check if it's Axious related issue or not by requesting the API with normal fetch (or others). I double-check and all of them have the same problem, I don't exactly why since after the tomorrow the issue fixes itself for some reason when I tried it again. Maybe restart your internet or double-check with your Node, that's my guess anyway. If anyone have an idea what causes this issue, feel free to fill in

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

3 participants