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

Bump Axios version? #58

Closed
gombosg opened this issue Dec 19, 2019 · 5 comments
Closed

Bump Axios version? #58

gombosg opened this issue Dec 19, 2019 · 5 comments

Comments

@gombosg
Copy link

gombosg commented Dec 19, 2019

Hi, I tried the new TS supported version but it throws "incompatible types" errors. It's probably, because the axios version is locked to ~0.18.0 but the latest release is 0.19. Maybe unblock this restriction so that npm could use the latest to avoid type conflicts?

Argument of type 'import("/node_modules/axios/index").AxiosInstance' is not assignable to parameter of type 'import("/node_modules/axios-auth-refresh/node_modules/axios/index").AxiosInstance'.
  The types of 'defaults.adapter' are incompatible between these types.
    Type 'import("/node_modules/axios/index").AxiosAdapter | undefined' is not assignable to type 'import("/node_modules/axios-auth-refresh/node_modules/axios/index").AxiosAdapter | undefined'.
      Type 'import("/node_modules/axios/index").AxiosAdapter' is not assignable to type 'import("/node_modules/axios-auth-refresh/node_modules/axios/index").AxiosAdapter'.
        Types of parameters 'config' and 'config' are incompatible.
          Type 'import("/node_modules/axios-auth-refresh/node_modules/axios/index").AxiosRequestConfig' is not assignable to type 'import("/node_modules/axios/index").AxiosRequestConfig'.
            Types of property 'method' are incompatible.
              Type 'string | undefined' is not assignable to type '"get" | "GET" | "delete" | "DELETE" | "head" | "HEAD" | "options" | "OPTIONS" | "post" | "POST" | "put" | "PUT" | "patch" | "PATCH" | undefined'.
                Type 'string' is not assignable to type '"get" | "GET" | "delete" | "DELETE" | "head" | "HEAD" | "options" | "OPTIONS" | "post" | "POST" | "put" | "PUT" | "patch" | "PATCH" | undefined'.

edit I'm happy to make a PR if we agree on some solution.

@Flyrell
Copy link
Owner

Flyrell commented Dec 19, 2019

I can't unblock it because of axios/axios#2295. The interceptor wouldn't work properly without the custom request parameters which were deleted in v0.19 of axios. This is a known bug and should be re-added to axios, but as of now, we cannot support axios 0.19

@gombosg
Copy link
Author

gombosg commented Dec 19, 2019

Then how come it is working fine for me on axios 0.19?

The project may have a dependency on 0.18 but you don't have control over the axios instance version that the library gets.
Also, this is not mentioned in the readme if it is mandatory to use 0.18.

(Or as long as I don't want to skip the interceptor, it will be fine?)

@Flyrell
Copy link
Owner

Flyrell commented Dec 28, 2019

This has been fixed in axios/axios#2207, so I guess we don't need to bother any more (it has not published yet). Also, I think it will be nice to add axios as an peerDependency instead of dependency.

@Flyrell Flyrell closed this as completed Dec 28, 2019
@tmilos
Copy link

tmilos commented Jan 13, 2020

@Flyrell Axios v0.19.1 is released and it includes axios/axios#2207. Can we get peerDependency to ~0.18.0 || ~0.19.1?

@Flyrell
Copy link
Owner

Flyrell commented Jan 13, 2020

@tmilos Will try to update ASAP. Would you please open a new issue? thanks

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