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

Wrong type for retry option #2272

Closed
2 tasks done
Cluster2a opened this issue Jun 18, 2023 · 1 comment
Closed
2 tasks done

Wrong type for retry option #2272

Cluster2a opened this issue Jun 18, 2023 · 1 comment

Comments

@Cluster2a
Copy link

Describe the bug

  • Node.js version: 19
  • OS & version:

Actual behavior

According to the index.d.ts the GotOptions accept a number or a RetryOptions for the retry attribute.
Passing the attribute leads to an exception: RequestError: Unexpected retry option: retries

Expected behavior

Passing the retry parameter as in the code below would not lead to an exception.
Both ways fail, but should be good, according to @types/got.

Code to reproduce

const response = await got(server.config.MINIO_HOST, {
	timeout: {
		lookup: 100,
		connect: 50,
		secureConnect: 50,
		socket: 1000,
		send: 10000,
		response: 1000
	},
	retry: {
		retries: 5
	}
});
const response = await got(server.config.MINIO_HOST, {
	timeout: {
		lookup: 100,
		connect: 50,
		secureConnect: 50,
		socket: 1000,
		send: 10000,
		response: 1000
	},
	retry: 5
});

Checklist

  • I have read the documentation.
  • I have tried my code with the latest version of Node.js and Got.
@sindresorhus
Copy link
Owner

Got ships with its own types. @types/got are outdated.

@sindresorhus sindresorhus closed this as not planned Won't fix, can't repro, duplicate, stale Jun 18, 2023
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

2 participants