dcloudio / uni-app

A cross-platform framework using Vue.js
https://uniapp.dcloud.io
Apache License 2.0
39.91k stars 3.62k forks source link

uts 开发鸿蒙 next 插件,uts 导入不了鸿蒙 next 第三方包 #5142

Open wl386123298 opened 1 week ago

wl386123298 commented 1 week ago

按照官方的教程用 uts 去调用鸿蒙 next 的支付宝相关插件,编译不通过,

HBuidler版本号: 4.26.2024082213-alpha

附上 uts 代码:

import { Pay } from '@cashier_alipay/cashiersdk'

export interface RequestPaymentOptions {
    orderInfo : string
}
export function requestPayment(options : RequestPaymentOptions) {
    return new Pay().pay(options.orderInfo, true)
}

编译报错信息如下:

[plugin:uni:uts-uni_modules] [uni:uts-uni_modules] load_transformed failed
Caused by:
   0: failed to analyze module
   1: failed to resolve @cashier_alipay/cashiersdk from /Users/wliang/Documents/xxx/src/uni_modules/hm-pay/utssdk/app-harmony/index.uts
  2: Impossible to get the node_modules path
 file: /Users/wliang/Documents/xxx/src/uni_modules/hm-pay?uts-proxy
 at uni_modules/hm-pay:1:0

请问如何解决这个问题

Wangyaqi commented 6 days ago

你这是cli项目吗?uni-app相关依赖版本是多少?

wl386123298 commented 6 days ago

你这是cli项目吗?uni-app相关依赖版本是多少?

不是 cli 项目,uni-app 的版本为:3.0.0-4020420240722002