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

Taro 3.6.2下 Taro.uploadFile() 在RN下报错, 在微信小程序和H5下没问题 #13513

Closed
SidneyLann opened this issue Mar 24, 2023 · 4 comments · Fixed by #13853
Closed
Labels
T-rn Target - 编译到 React Native V-3 Version - 3.x

Comments

@SidneyLann
Copy link
Contributor

SidneyLann commented Mar 24, 2023

相关平台

React Native

复现仓库

https://github.com/SidneyLann/taro-test-repo.git

使用框架: React

复现步骤

  1. yarn android
  2. 点击界面中的加号,选择图片
  3. 确定后报错:Error: chooseImage:Cannot convert undefined value to object
    at anonymous (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mall362&modulesOnly=false&runModule=true:101065:33)
    at tryCallOne (/root/react-native/ReactAndroid/hermes-engine/.cxx/Release/3c5g4m5f/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:53:16)
    at anonymous (/root/react-native/ReactAndroid/hermes-engine/.cxx/Release/3c5g4m5f/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:139:27)
    at apply (native)

期望结果

RN下能上传文件

实际结果

RN下不能上传文件

环境信息

👽 Taro v3.6.2


  Taro CLI 3.6.2 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 18.14.0 - D:\DEV\nodejs\node.EXE
      Yarn: 1.22.19 - D:\DEV\nodejs\yarn.CMD
      npm: 9.3.1 - D:\DEV\nodejs\npm.CMD
@TheKonka TheKonka added V-3 Version - 3.x T-rn Target - 编译到 React Native labels Mar 24, 2023
@SidneyLann
Copy link
Contributor Author

没进展吗?

@SidneyLann
Copy link
Contributor Author

打算吞下这个bug了吗?

@yechunxi
Copy link
Collaborator

问题已经找到,API的formData参数无默认值引起的问题。会尽快修复,可先给 formData 加个默认值解决

Taro.uploadFile({
    formData:{},
   ....
})

@SidneyLann
Copy link
Contributor Author

Ok, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-rn Target - 编译到 React Native V-3 Version - 3.x
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants