From b072ee8e0c628bd5e4706ba38887b9f60720c3d8 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Sun, 26 Apr 2026 11:52:10 +0100 Subject: [PATCH] fix(types): align cjs cancelToken types (#7414) the import/esm types include `undefined` (ref: https://github.com/axios/axios/blob/v1.x/index.d.ts#L457) this was added recently in #5560 - but only to `index.d.ts`, which can break type-checking in projects using a mixture of cjs and esm, when `exactOptionalPropertyTypes` is enabled, as it makes the request config types incompatible with eachother. you can see an example of the type error / this patch resolving it on https://github.com/mnahkies/openapi-code-generator/pull/427 Co-authored-by: Jay --- index.d.cts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.d.cts b/index.d.cts index 81d2296d..0a022479 100644 --- a/index.d.cts +++ b/index.d.cts @@ -503,7 +503,7 @@ declare namespace axios { httpAgent?: any; httpsAgent?: any; proxy?: AxiosProxyConfig | false; - cancelToken?: CancelToken; + cancelToken?: CancelToken | undefined; decompress?: boolean; transitional?: TransitionalOptions; signal?: GenericAbortSignal;