e***@outlook.com
e***@outlook.com
  • 发布:2022-10-06 15:22
  • 更新:2022-11-04 16:15
  • 阅读:304

【报Bug】new plus.io.FileReader()编译失败

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: 12.6

手机系统: iOS

手机系统版本号: iOS 15

手机厂商: 苹果

手机机型: iphone 13

页面类型: nvue

vue版本: vue2

打包方式: 离线

项目创建方式: CLI

CLI版本号: 3.1.17

示例代码:

reader = new plus.io.FileReader();

操作步骤:

reader = new plus.io.FileReader();

预期结果:

可以正常编译成功

实际结果:

[HBuilder] 15:10:19.906 ERROR in /Users/taylor/Project/app/src/app.ts(415,34):
[HBuilder] 15:10:19.909 415:34 This expression is not constructable.
[HBuilder] 15:10:19.910 Type 'PlusIoFileReader' has no construct signatures.
[HBuilder] 15:10:19.914 413 | // 文件系统中的读取文件对象,用于获取文件的内容
[HBuilder] 15:10:19.917 414 | try {
[HBuilder] 15:10:19.928 > 415 | reader = new plus.io.FileReader(); // new一个可以用来读取文件的对象fileReader
[HBuilder] 15:10:19.929 | ^
[HBuilder] 15:10:19.932 416 | } catch (error) {
[HBuilder] 15:10:19.940 417 | uni.showToast({
[HBuilder] 15:10:19.944 418 | title: "读取失败",
[HBuilder] 15:10:20.062 项目 'app' 编译成功。
[HBuilder] 15:10:20.066 ERROR in /Users/taylor/Project/app/src/app.ts(415,34):
[HBuilder] 15:10:20.066 415:34 This expression is not constructable.
[HBuilder] 15:10:20.069 Type 'PlusIoFileReader' has no construct signatures.
[HBuilder] 15:10:20.073 413 | // 文件系统中的读取文件对象,用于获取文件的内容
[HBuilder] 15:10:20.076 414 | try {
[HBuilder] 15:10:20.076 > 415 | reader = new plus.io.FileReader(); // new一个可以用来读取文件的对象fileReader
[HBuilder] 15:10:20.080 | ^
[HBuilder] 15:10:20.083 416 | } catch (error) {
[HBuilder] 15:10:20.092 417 | uni.showToast({
[HBuilder] 15:10:20.092 418 | title: "读取失败",
[HBuilder] 15:10:20.096 ERROR Build failed with errors.
[HBuilder] 15:10:20.149 项目 'app'导出失败

bug描述:

2022-10-06 15:22 负责人:无 分享
已邀请:
DCloud_UNI_WZF

DCloud_UNI_WZF

测试未复现该问题,请检查代码或提供可复现demo

e***@outlook.com

e***@outlook.com (作者)

问题已解决

要回复问题请先登录注册