When the uniapp project runs for the first time in the Alipay developer tool, an error is reported: when the subpackage application enables "lazyCodeLoading", "subPackageBuildType": "shared" must be enabled at the same time

reproduce bug

When the uniapp project runs for the first time in the Alipay developer tool, it reports an error VM235:3 Module Error (from C:/snapshot/cube/node_modules/@ali/antcube-build/lib/build/loader/app.js):
Subpackage application enables "lazyCodeLoading " must be enabled at the same time "subPackageBuildType": "shared"

Error screenshot

insert image description here

Solution

Add **"subPackageBuildType": "shared"** in the manifest.json file, it's ok

"mp-alipay" : {
    
    
"usingComponents" : true,
"appid" : "你的支付宝小程序ID",
"lazyCodeLoading" : "requiredComponents",
"subPackageBuildType": "shared",//这一句
"uniStatistics" : {
    
    
"enable" : true
}
},

Guess you like

Origin blog.csdn.net/qq_51463650/article/details/128860901