-
-
Notifications
You must be signed in to change notification settings - Fork 11.5k
Description
Describe the bug
We generate some client code with OpenAPI Generator and generate types for it calling tsc
The type definition generated prior 1.7.8. looks like
someAPIMethod(requestParameters: SomeRequestParameters, options?: RequestOptions): Promise<import("axios").AxiosResponse<void, any>>;
when we change to 1.7.8 it becomes:
someAPIMethod(requestParameters: SomeRequestParameters, options?: RequestOptions): Promise<import("axios", { with: { "resolution-mode": "require" } }).AxiosResponse<void, any>>;
Which no longer builds.
I think the culprit is This commit
Typescript recognizes the import from the commonjs types and thinks that the module is commonjs and adds the resolution-mode hint.
I don't think it is correct to import from cjs inside the (ESM)ts types.
To Reproduce
No response
Code snippet
No response
Expected behavior
No response
Axios Version
1.7.8
Adapter Version
No response
Browser
No response
Browser Version
No response
Node.js Version
No response
OS
No response
Additional Library Versions
No response
Additional context/Screenshots
No response