必现
- 发布:2022-06-30 13:41
- 更新:2022-07-20 16:17
- 阅读:2171
产品分类: uniapp/小程序/阿里
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win10
HBuilderX类型: 正式
HBuilderX版本号: 3.4.15
第三方开发者工具版本号: 3.1.2
基础库版本号: 2.7.21
项目创建方式: HBuilderX
操作步骤:
预期结果:
正常编译
正常编译
实际结果:
编译失败
编译失败
bug描述:
uniapp编译可以成功,但支付宝小程序编译失败,报错提示如下:
ERROR in ./app.json
Module Error (from C:/snapshot/code-repo/out/target/bundle/node_modules/@ali/antcube-build/lib/build/loader/app.js):
[Tip] app.usingComponents should needs to be used with app.lazyCodeLoading!
ERROR in ./app.json
Module Error (from C:/snapshot/code-repo/out/target/bundle/node_modules/@ali/antcube-build/lib/build/loader/web-concurrent.js):
[Tip] app.usingComponents should needs to be used with app.lazyCodeLoading!
ERROR in ./app.json:
Error: Init seriable context failed
at C:\snapshot\code-repo\out\target\bundle\node_modules\@ali\antcube-build\lib\build\loader\impl\helper\entry\context.js:1:721
at step (C:\snapshot\code-repo\out\target\bundle\node_modules\tslib\tslib.js:144:27)
at Object.next (C:\snapshot\code-repo\out\target\bundle\node_modules\tslib\tslib.js:125:57)
at C:\snapshot\code-repo\out\target\bundle\node_modules\tslib\tslib.js:118:75
at new Promise (<anonymous>)
at Object.__awaiter (C:\snapshot\code-repo\out\target\bundle\node_modules\tslib\tslib.js:114:16)
at extractSeriableContext (C:\snapshot\code-repo\out\target\bundle\node_modules\@ali\antcube-build\lib\build\loader\impl\helper\entry\context.js:1:328)
at C:\snapshot\code-repo\out\target\bundle\node_modules\@ali\antcube-build\lib\build\loader\impl\mode\concurrent\asset.js:1:1384
at step (C:\snapshot\code-repo\out\target\bundle\node_modules\tslib\tslib.js:144:27)
at Object.next (C:\snapshot\code-repo\out\target\bundle\node_modules\tslib\tslib.js:125:57)
at C:\snapshot\code-repo\out\target\bundle\node_modules\tslib\tslib.js:118:75
at new Promise (<anonymous>)
at Object.__awaiter (C:\snapshot\code-repo\out\target\bundle\node_modules\tslib\tslib.js:114:16)
at processConcurrentAsset (C:\snapshot\code-repo\out\target\bundle\node_modules\@ali\antcube-build\lib\build\loader\impl\mode\concurrent\asset.js:1:1185)
at C:\snapshot\code-repo\out\target\bundle\node_modules\@ali\antcube-build\lib\build\loader\impl\mode\concurrent\index.js:1:1255
at step (C:\snapshot\code-repo\out\target\bundle\node_modules\tslib\tslib.js:144:27)
我经过尝试发现在构建后的支付宝小程序代码里,删掉usingComponents配置项或者在、再加上"lazyCodeLoading": "requiredComponents"配置不报错
但是目前从uni的配置里,我还没有找到把"lazyCodeLoading": "requiredComponents"配置进支付宝小程序配置里的办法
3 个回复
郑一 (作者) - try
降级支付宝小程序开发者工具到3.1以下可以暂时不报错
haoyuol
已经解决
"mp-alipay" : {
"usingComponents" : true,
"appid" : "你的支付宝小程序ID",
"lazyCodeLoading" : "requiredComponents",
"uniStatistics" : {
"enable" : true
}
},
DCloud_UNI_GSQ
升级支付宝小程序beta版到3.1.3,可以看到更新日志:
修复 app.json 中使用 usingComponents 时,提示必须开启 lazyCodeLoading 的编译报错。