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

JS client: latest axios version causes type errors #272

Open
mvandenburgh opened this issue Jul 8, 2022 · 0 comments
Open

JS client: latest axios version causes type errors #272

mvandenburgh opened this issue Jul 8, 2022 · 0 comments

Comments

@mvandenburgh
Copy link
Member

From the code for the S3FileFieldClient constructor:

/**
   * Create an S3FileFieldClient instance.
   *
   * @param options {S3FileFieldClientOptions} - A Object with all arguments.
   * @param options.baseUrl - The absolute URL to the Django server.
   * @param [options.apiConfig] - An axios configuration to use for Django API requests.
   *                              Can be extracted from an existing axios instance via `.defaults`.
   */

On the latest version of axios, axiosInstance.defaults returns an object of type AxiosDefaults instead of AxiosRequestConfig as it did before. This is a new type introduced in axios/axios@94a9344#diff-7aa4473ede4abd9ec099e87fec67fd57afafaf39e05d493ab4533acc38547eb8L151-R171 that slightly differs from AxiosRequestConfig. Since S3FileFieldClient expects apiConfig to be of type AxiosRequestConfig, using axiosInstance.defaults as the example specifies results in a type error.

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

No branches or pull requests

1 participant