taro-ui icon indicating copy to clipboard operation
taro-ui copied to clipboard

用rollup打包组件库,打包后的文件引用Taro下的api,默认加了一级default,类似于Taro.makePhoneCall打完包后就变成了Taro.default.makePhoneCall,但是Taro.default下面没有makePhoneCall这个方法,还有一些api也不行。

Open lhkg1988 opened this issue 3 years ago • 3 comments

问题描述 用rollup打包组件库,打包后的文件引用Taro下的api,默认加了一级default,类似于Taro.makePhoneCall打完包后就变成了Taro.default.makePhoneCall,但是Taro.default下面没有makePhoneCall这个方法,还有一些api也不行。

复现步骤

ca4c0505940a0fa4ff9181239e81cc8

期望行为 期望组件库中也能够正常调用

报错信息 MiniProgramError TypeError: i.a.getStorageSync is not a function

系统信息 👽 Taro v3.3.10

Taro CLI 3.3.10 environment info: System: OS: Windows 10 Binaries: Node: 14.17.6 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.10 - D:\User\hliu\AppData\Roaming\npm\yarn.CMD npm: 6.14.15 - C:\Program Files\nodejs\npm.CMD

补充信息 Taro下面有default,但是default里面的方法较少,不全,导致引用就报不是一个方法

lhkg1988 avatar Dec 08 '21 11:12 lhkg1988

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

taro-ui-bot[bot] avatar Dec 08 '21 11:12 taro-ui-bot[bot]

没人维护了

lhkg1988 avatar Dec 17 '21 06:12 lhkg1988

来错仓库了,这里提,https://github.com/NervJS/taro/issues

还有环境信息使用 taro info 查看,更详细点,最好提供 demo

shinken008 avatar Jan 10 '22 03:01 shinken008