Closed Iso5786 closed 3 years ago
A colleague showed me that with webpack one should load modules dynamically at runtime (see https://rustwasm.github.io/wasm-pack/book/tutorials/hybrid-applications-with-webpack/using-your-library.html).
I also installed Edge Webview 2 (https://developer.microsoft.com/en-us/microsoft-edge/webview2/#download-section); consequently the addin runs under the Chrome engine, version 90.
Now I am getting the error:
I also checked the following stackoverflow: https://stackoverflow.com/questions/63494610/can-not-use-web-assembly-rust-impl-because-of-cannot-access-wbindgen-throw
However, I am already using the experiments option syncWebassembly: true , and it doe not solve the issue.
In the meantime I got it working by stumbling on this issue and related comment: https://github.com/babel/babel-loader/issues/560#issuecomment-428544754
Expected behavior
I followed the hello world guide from https://rustwasm.github.io/docs/book/game-of-life/hello-world.html to try to load a WASM module into an Outlook addin. I expected that after I added the code to my addin's JS file to raise an alert.
Current behavior
After importing the WASM module via
import * as wasm from "irmaseal-wasm-bindings"
(that's how I called the module) and invoking wasm.greet() I get an error in the console:Unable to get property 'greet' of undefined or null reference
(from index_bg.js)The office version I use is 2019.
I figured that the Outlook addin runs under Edge version 18 as "Edge 18" is what I get as output when following https://stackoverflow.com/questions/5916900/how-can-you-detect-the-version-of-a-browser
And Edge 18 supports web assembly according to: https://developer.mozilla.org/en-US/docs/WebAssembly#browser_compatibility
So I am wondering if I still need to enable WASM support in the addin somehow, add a certain content security policy, etc. Or is WASM just not supported (yet) for Outlook addins even though (it looks like) Edge 18 runs under the hood?
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Failure Logs
Console:
Index_bg.js: