林枫
林枫
  • 发布:2022-06-29 11:19
  • 更新:2022-07-20 16:17
  • 阅读:1047

运行到支付宝小程序报错

分类:uni-app

Hbuilder X编译时没问题,但是在支付宝小程序开发者工具运行就报错了,错误如下:
Failed to compile
Module Error (from /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!
Module Error (from /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!
Module build failed (from /snapshot/code-repo/out/target/bundle/node_modules/@ali/antcube-build/lib/build/loader/app.js):
Error: Init seriable context failed
at /snapshot/code-repo/out/target/bundle/node_modules/@ali/antcube-build/lib/build/loader/impl/helper/entry/context.js:1:721
at step (/snapshot/code-repo/out/target/bundle/node_modules/tslib/tslib.js:144:27)
at Object.next (/snapshot/code-repo/out/target/bundle/node_modules/tslib/tslib.js:125:57)
at /snapshot/code-repo/out/target/bundle/node_modules/tslib/tslib.js:118:75
at new Promise (<anonymous>)
at Object.awaiter (/snapshot/code-repo/out/target/bundle/node_modules/tslib/tslib.js:114:16)
at extractSeriableContext (/snapshot/code-repo/out/target/bundle/node_modules/@ali/antcube-build/lib/build/loader/impl/helper/entry/context.js:1:328)
at /snapshot/code-repo/out/target/bundle/node_modules/@ali/antcube-build/lib/build/loader/impl/mode/concurrent/asset.js:1:1384
at step (/snapshot/code-repo/out/target/bundle/node_modules/tslib/tslib.js:144:27)
at Object.next (/snapshot/code-repo/out/target/bundle/node_modules/tslib/tslib.js:125:57)
at /snapshot/code-repo/out/target/bundle/node_modules/tslib/tslib.js:118:75
at new Promise (<anonymous>)
at Object.
awaiter (/snapshot/code-repo/out/target/bundle/node_modules/tslib/tslib.js:114:16)
at processConcurrentAsset (/snapshot/code-repo/out/target/bundle/node_modules/@ali/antcube-build/lib/build/loader/impl/mode/concurrent/asset.js:1:1185)
at /snapshot/code-repo/out/target/bundle/node_modules/@ali/antcube-build/lib/build/loader/impl/mode/concurrent/index.js:1:1255
at step (/snapshot/code-repo/out/target/bundle/node_modules/tslib/tslib.js:144:27)
Module build failed (from /snapshot/code-repo/out/target/bundle/node_modules/@ali/antcube-build/lib/build/loader/web-concurrent.js):
Error: Init seriable context failed
at /snapshot/code-repo/out/target/bundle/node_modules/@ali/antcube-build/lib/build/loader/impl/helper/entry/context.js:1:721
at step (/snapshot/code-repo/out/target/bundle/node_modules/tslib/tslib.js:144:27)
at Object.next (/snapshot/code-repo/out/target/bundle/node_modules/tslib/tslib.js:125:57)
at /snapshot/code-repo/out/target/bundle/node_modules/tslib/tslib.js:118:75
at new Promise (<anonymous>)
at Object.awaiter (/snapshot/code-repo/out/target/bundle/node_modules/tslib/tslib.js:114:16)
at extractSeriableContext (/snapshot/code-repo/out/target/bundle/node_modules/@ali/antcube-build/lib/build/loader/impl/helper/entry/context.js:1:328)
at /snapshot/code-repo/out/target/bundle/node_modules/@ali/antcube-build/lib/build/loader/impl/mode/concurrent/client.js:1:576
at step (/snapshot/code-repo/out/target/bundle/node_modules/tslib/tslib.js:144:27)
at Object.next (/snapshot/code-repo/out/target/bundle/node_modules/tslib/tslib.js:125:57)
at /snapshot/code-repo/out/target/bundle/node_modules/tslib/tslib.js:118:75
at new Promise (<anonymous>)
at Object.
awaiter (/snapshot/code-repo/out/target/bundle/node_modules/tslib/tslib.js:114:16)
at processConcurrentClient (/snapshot/code-repo/out/target/bundle/node_modules/@ali/antcube-build/lib/build/loader/impl/mode/concurrent/client.js:1:403)
at /snapshot/code-repo/out/target/bundle/node_modules/@ali/antcube-build/lib/build/loader/impl/mode/concurrent/index.js:1:1592
at step (/snapshot/code-repo/out/target/bundle/node_modules/tslib/tslib.js:144:27)

2022-06-29 11:19 负责人:无 分享
已邀请:
林枫

林枫 (作者) - 885919

代码有点老,是19年开发的 之前一直运行在微信小程序上没问题,现在需要运行到支付宝上面去

林枫

林枫 (作者) - 885919

有官方大佬可以帮忙看看吗

DCloud_UNI_GSQ

DCloud_UNI_GSQ

lazyCodeLoading 配置成 false 试试

  • 浪里白条999

    我也遇到了,在问答社区看好多人都遇到这个问题了,manifest没找到配置支付宝小程序"lazyCodeLoading": "requiredComponents"的方法,建议官方修复一下,而且这个问题只发现在mac电脑上,win上面可以正常跑

    2022-07-07 11:15

郑一

郑一 - try

我也遇到了同样的问题
目前我尝试发现:在构建后的支付宝小程序代码里,删掉usingComponents配置项或者在加上"lazyCodeLoading": "requiredComponents"配置不报错

但是目前从uni的配置里,我还没有找到把"lazyCodeLoading": "requiredComponents"配置进支付宝小程序配置里的办法

haoyuol

haoyuol

已经解决
"mp-alipay" : {
"usingComponents" : true,
"appid" : "你的支付宝小程序ID",
"lazyCodeLoading" : "requiredComponents",
"uniStatistics" : {
"enable" : true
}
},

DCloud_UNI_GSQ

DCloud_UNI_GSQ

升级支付宝小程序beta版到3.1.3,可以看到更新日志:

修复 app.json 中使用 usingComponents 时,提示必须开启 lazyCodeLoading 的编译报错。

要回复问题请先登录注册