reader = new plus.io.FileReader();
![e***@outlook.com](http://img-cdn-tc.dcloud.net.cn/uploads/avatar/002/06/21/38_avatar_mid.jpg?v=1662019019)
- 发布:2022-10-06 15:22
- 更新:2022-11-04 16:15
- 阅读:434
产品分类: 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'导出失败
[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描述:
![](http://img-cdn-tc.dcloud.net.cn/uploads/questions/20221006/e14b75ee7d39933cba4a69fdf84ab053.png)
![](http://img-cdn-tc.dcloud.net.cn/uploads/questions/20221006/7c9192db27d199d6062116ea5c7d19db.png)