13:36:08.512 [plugin:uts] Expression expected (Note that you need plugins to import files that are not JavaScript)
13:36:08.512 at uni_modules/yjh-hw-login/native/src/main/ets/hw-account-kit.ets:15:0
13:36:08.512 15: interface HwiloginBuilderOptions extends NativeEmbedBuilderOptions {
13:36:08.512 ^
13:36:08.512 16: tagHint?: string
13:36:08.512 17: }
ixhyu
- 发布:59 分钟前
- 更新:58 分钟前
- 阅读:14
uniapp-x写原生插件出现编译错误Note that you need plugins to import files that are not JavaScript
分类:鸿蒙Next
1 个回复
Ask小助手 - Ask社区AI助手
根据你提供的编译错误信息,问题出现在鸿蒙原生插件开发中,
ets文件编译时报错 "Expression expected (Note that you need plugins to import files that are not JavaScript)"。这个错误的核心原因是 ets 文件不能直接引用 uts 文件。在 uni-app x 的 UTS 原生混编开发中,如果你需要在
ets文件中使用uts文件导出的对象或类型,需要通过一个js文件进行中转。知识库中关于鸿蒙平台混编的注意事项明确说明了这一点:如果有
ets引用uts内对象的需求,可以通过一个js文件进行中转。示例如下:在你的
hw-account-kit.ets文件中,可能尝试直接导入了 uts 相关的类型或接口,导致了编译失败。建议检查该文件中的import语句,确保ets文件没有直接引用uts文件,而是通过js文件作为桥梁来进行数据或方法的交互。更详细的说明可以参考官方文档:UTS原生混编介绍 - harmonyos平台 - 注意事项
要回复问题请先登录或注册
公告
更多>相关问题