小程序在插件中使用 WebAssembly ,iOS 偶现 WXWebAssembly.instantiate 异常。
插件侧代码如下:
async function __wbg_init() {
if (wasm !== undefined) return wasm;
const imports = __wbg_get_imports();
const { instance, module } = await WXWebAssembly.instantiate('utils/crypto.wasm.br', imports);
return __wbg_finalize_init(instance, module);
}
报错如下:
@[native code]
@
N@https://lib/WAServiceMainContext.js:1:72514
@
@https://lib/WAServiceMainContext.js:1:1847563
s@https://usr//__plugin__/wxebbb8eded25ba277/appservice.js:1099:742
@https://usr//__plugin__/wxebbb8eded25ba277/appservice.js:1099:2076
asyncGeneratorStep@https://usr//__plugin__/wxebbb8eded25ba277/appservice.js:1092:58
c@https://usr//__plugin__/wxebbb8eded25ba277/appservice.js:1092:295
@https://usr//__plugin__/wxebbb8eded25ba277/appservice.js:1092:371
j@https://lib/WASubContext.js:1:72523
@https://usr//__plugin__/wxebbb8eded25ba277/appservice.js:1092:228
s@https://usr//__plugin__/wxebbb8eded25ba277/appservice.js:1099:742
@https://usr//__plugin__/wxebbb8eded25ba277/appservice.js:1099:2076
asyncGeneratorStep@https://usr//__plugin__/wxebbb8eded25ba277/appservice.js:1092:58
c@https://usr//__plugin__/wxebbb8eded25ba277/appservice.js:1092:295
@https://usr//__plugin__/wxebbb8eded25ba277/appservice.js:1092:371
j@https://lib/WASubContext.js:1:72523
@https://usr//__plugin__/wxebbb8eded25ba277/appservice.js:1092:228
@https://usr//__plugin__/wxebbb8eded25ba277/appservice.js:1106:105
@https://lib/WASubContext.js:1:514035
runWith@https://lib/WASubContext.js:1:509465
S@https://lib/WASubContext.js:1:514019
@https://usr//__plugin__/wxebbb8eded25ba277/appservice.js:1126:17
@https://usr//appservice.app.js:17:257
@https://lib/WASubContext.js:1:520013
runWith@https://lib/WASubContext.js:1:509465
V@https://lib/WASubContext.js:1:519997
r@https://lib/WASubContext.js:1:518810
@https://usr//appservice.app.js:21:228
@https://lib/WASubContext.js:1:520013
runWith@https://lib/WASubContext.js:1:509465
V@https://lib/WASubContext.js:1:519997
@https://lib/WASubContext.js:1:511930
forEach@[native code]
flushQueue@https://lib/WASubContext.js:1:511910
@https://lib/WAServiceMainContext.js:1:2313942
n@https://lib/WAServiceMainContext.js:1:111478
Le@https://lib/WAServiceMainContext.js:1:111551
Le@[native code]
@https://lib/WAServiceMainContext.js:1:2313845
@https://lib/WAServiceMainContext.js:1:2309616
@https://lib/WAServiceMainContext.js:1:625253
emit@https://lib/WAServiceMainContext.js:1:630749
@https://lib/WAServiceMainContext.js:1:1097032
@https://lib/WAServiceMainContext.js:1:622076
@https://lib/WAServiceMainContext.js:1:613026
emit@https://lib/WAServiceMainContext.js:1:119174
emit@[native code]
emit@https://lib/WAServiceMainContext.js:1:118793
subscribeHandler@https://lib/WAServiceMainContext.js:1:122317
排查后推断报错与业务无关,烦请排查下 WXWebAssembly.instantiate 的实现,谢谢