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

Getting type errors with Axios #6

Closed
charliematters opened this issue Jun 13, 2023 · 4 comments · Fixed by #7
Closed

Getting type errors with Axios #6

charliematters opened this issue Jun 13, 2023 · 4 comments · Fixed by #7

Comments

@charliematters
Copy link

charliematters commented Jun 13, 2023

Hi,

fromPartial seems to work perfectly for replacing every type-cast in our test suite except when we do fromPartial<AxioInstance>({}). We're using Axios 0.27.2 and shoehorn 0.10, but it seems to be requiring all the fields of an instance. I can flesh out this ticket tomorrow with the actual error, but I thought I'd ask in case it's something obvious.

A Codesandbox showing the TS Error is here: https://codesandbox.io/s/falling-currying-pv8lfk?file=/src/Shoehorn.spec.ts:

Type '{}' is missing the following properties from type 'AxiosInstance': defaults, interceptors, getUri, request, and 10 more.ts(2345)

@mattpocock
Copy link
Collaborator

Interesting, I'll do some checking on this. It looks like AxiosInstance is a function? One with multiple overloads.

I could see that causing an issue.

@mattpocock
Copy link
Collaborator

Whoops, didn't mean to close.

@mattpocock mattpocock reopened this Jun 14, 2023
@charliematters
Copy link
Author

Thanks for looking into it. It's been integral to me removing hundreds of casts!

mattpocock added a commit that referenced this issue Jun 14, 2023
mattpocock added a commit that referenced this issue Jun 14, 2023
@mattpocock
Copy link
Collaborator

Fixed in 0.1.1

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

Successfully merging a pull request may close this issue.

2 participants