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

fix(types): extend from AxiosStatic #319

Merged
merged 3 commits into from Jan 11, 2020
Merged

fix(types): extend from AxiosStatic #319

merged 3 commits into from Jan 11, 2020

Conversation

MrJmpl3
Copy link
Contributor

@MrJmpl3 MrJmpl3 commented Jan 2, 2020

The error is: TS2339: Property 'CancelToken' does not exist on type 'NuxtAxiosInstance'.

https://axios.nuxtjs.org/usage#cancel-token

const { CancelToken } = this.$axios

The error is: TS2339: Property 'CancelToken' does not exist on type 'NuxtAxiosInstance'.
@codecov
Copy link

codecov bot commented Jan 2, 2020

Codecov Report

Merging #319 into dev will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@         Coverage Diff         @@
##            dev   #319   +/-   ##
===================================
  Coverage   100%   100%           
===================================
  Files         1      1           
  Lines        30     30           
  Branches     13     13           
===================================
  Hits         30     30

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8435a83...3da485a. Read the comment docs.

@ricardogobbosouza
Copy link
Member

Resolve #322

Copy link
Member

@kevinmarrec kevinmarrec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import needs to be changed

@MrJmpl3
Copy link
Contributor Author

MrJmpl3 commented Jan 11, 2020

The import needs to be changed

I don't understand, Why the import need be changed?

@kevinmarrec
Copy link
Member

kevinmarrec commented Jan 11, 2020

@MrJmpl3 First line of the file, AxiosInstance needs to be replaced by AxiosStatic
(github is buggy to suggest changes on the first line somehow)

types/index.d.ts Outdated
@@ -1,8 +1,8 @@
import { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'
import { AxiosError, AxiosStatic, AxiosRequestConfig, AxiosResponse } from 'axios'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { AxiosError, AxiosStatic, AxiosRequestConfig, AxiosResponse } from 'axios'
import { AxiosError, AxiosRequestConfig, AxiosResponse, AxiosStatic } from 'axios'

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 this pull request may close these issues.

None yet

4 participants