乐天愁
乐天愁
  • 发布:2022-09-24 11:29
  • 更新:2022-10-18 14:52
  • 阅读:442

【报Bug】uts插件export default class 不起作用

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

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

HBuilderX类型: 正式

HBuilderX版本号: 3.6.4

手机系统: Android

手机系统版本号: Android 12

手机厂商: 华为

手机机型: Mate30E

页面类型: vue

vue版本: vue3

打包方式: 云端

项目创建方式: HBuilderX

示例代码:
// 导出类  
export default class VideoPlayer {  
    private videoView?: VideoView = null;  
    private videoPath = '';  
    private autoPlay = false;  
    ...  
}  

// 导入类  
import VideoPlayer from '@/uni_modules/lx-videoplayer';

操作步骤:
  1. 创建uts插件
  2. 在index.uts中导出类
  3. 在index.vue页面引用

预期结果:

可以正常导入

实际结果:

提示错误:
11:22:49.119 Error when using sourcemap for reporting an error: Can't resolve original location of error.
11:22:49.120 'default' is not exported by ........\workspace\uts-player\uni_modules\lx-videoplayer\utssdk\app-android\index.uts, imported by ........\workspace\uts-player\pages\index\index.vue

bug描述:

在uts插件里通过export default导出类,在页面引用的时候提示错误:
11:22:49.119 Error when using sourcemap for reporting an error: Can't resolve original location of error.
11:22:49.120 'default' is not exported by ........\workspace\uts-player\uni_modules\lx-videoplayer\utssdk\app-android\index.uts, imported by ........\workspace\uts-player\pages\index\index.vue

2022-09-24 11:29 负责人:无 分享
已邀请:
DCloud_UNI_FXY

DCloud_UNI_FXY

已确认,下个版本修复
目前可以先采用非default的导出class

DCloud_UNI_Anne

DCloud_UNI_Anne

HBuilderX3.6.7-alpha已修复

要回复问题请先登录注册