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

还在维护吗?兼容一下最新版本的axios吧 #2

Closed
LittleSource opened this issue Feb 10, 2023 · 6 comments
Closed

还在维护吗?兼容一下最新版本的axios吧 #2

LittleSource opened this issue Feb 10, 2023 · 6 comments

Comments

@LittleSource
Copy link

No description provided.

@lcysgsg
Copy link
Owner

lcysgsg commented Feb 10, 2023

可以具体描述一下是遇到了什么问题吗?连同 #1 一起周末更新

@LittleSource
Copy link
Author

最新版的axios在创建的时候会报错fromData对象找不到

const instance = axios.create({
  baseURL: 'URL.com',
  adapter: axiosAdapterUniapp,
})

我怀疑是axios.create这个函数在内部使用fromData对象,但是uniapp没有这个对象造成的,
感觉这个问题没办法解决...

@lcysgsg
Copy link
Owner

lcysgsg commented Feb 12, 2023

我尝试了 axios ^1.3.2^0 没有发现你提到的问题,也许是步骤不正确,最好提供一个可复现的示例仓库。

还有,axios^1 版本做了太多变化,直接使用已经不行了,我也有段时间没有关注 uniapp与axios的最新变化了,研究下再更新一版

@lcysgsg
Copy link
Owner

lcysgsg commented Feb 13, 2023

我在微信小程序复现了这个问题,不是 uniapp 没有这个对象,是运行环境没有提供该API。而 axios ^1 版本总是引用到了 FormData Blob 等API。

所以,axios ^1 暂时是支持不了了,如果真的要用axios, 需要限定版本 ^0

在这里追踪关于新的进展 axios/axios#5543

@LittleSource
Copy link
Author

看起来 axios^1.3.3 解决了这个问题 axios/axios#5545

@lcysgsg
Copy link
Owner

lcysgsg commented Feb 14, 2023

看起来 axios^1.3.3 解决了这个问题 axios/axios#5545

不完全,还有两处要改,他漏了,我还在沟通

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

2 participants