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

Serenity-JS/rest: Axios version issue when using an AxiosInstance with latest axios version #1223

Closed
viper3400 opened this issue Jun 1, 2022 · 2 comments
Milestone

Comments

@viper3400
Copy link
Sponsor Collaborator

I had to adjust the timeout of my axios instance as mentioned in #1196 described in the second example here

To do so, I run npm install axios which added the latest axios version, at the time of writing this was 0.27.4.

It results in this error:

Argument of type 'import("C:/.../e2e-serenityjs/node_modules/axios/index").AxiosInstance' is not assignable to parameter of type 'import("C:/.../e2e-serenityjs/node_modules/@serenity-js/rest/node_modules/axios/index").AxiosInstance'.
  The types of 'defaults.method' are incompatible between these types.
    Type 'string' is not assignable to type 'Method'.ts(2345)

@serenity-js/rest still uses an axios version 0.21.4

I downgraded the axios package in my project to this version - and it was working again.

I did no further analysis so far, so I'm not sure if this is just because of the general version mismatch or if breaking changes where introduced in axios meanwhile.

@viper3400 viper3400 changed the title Serenity-JS/rest: Axios version problem when using an AxiosInstance Serenity-JS/rest: Axios version issue when using an AxiosInstance Jun 1, 2022
@viper3400 viper3400 changed the title Serenity-JS/rest: Axios version issue when using an AxiosInstance Serenity-JS/rest: Axios version issue when using an AxiosInstance with lates axios version Jun 1, 2022
@viper3400 viper3400 changed the title Serenity-JS/rest: Axios version issue when using an AxiosInstance with lates axios version Serenity-JS/rest: Axios version issue when using an AxiosInstance with latest axios version Jun 1, 2022
@jan-molak
Copy link
Member

Hey @viper3400, @serenity-js/rest is purposefully depending on an older version of Axios, since the newer ones have this issue - axios/axios#4124

A fix to that has been merged to Axios master, but it looks like it's never been released - axios/axios#4229

Interestingly enough, based on axios/axios#4304 (comment), I see that @alecgibson has updated @types/node to introduce AbortController and AbortSignal - DefinitelyTyped/DefinitelyTyped#58270, so we might be able to upgrade our dependency on Axios even without axios/axios#4229

@jan-molak
Copy link
Member

Released in 3.0.0-rc.19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants