Forum Discussion
Is it possible to load WebAssembly file from custom visual?
WASM is not supported by pbiviz tools. We're migrating to webpack that can compile WASM pretty well.
To load external resource such as JS or WASM a server must support CORS.
Otherwise, remote connection will be refused by browser.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
I am trying to build a custom visual in power bi using a library called IFC.js. I have bundled it using webpack hoping that the .wasm files would get compiled. I have been trying to integrate this:
https://github.com/IFCjs/web-ifc-viewer/tree/master/example
into the custom visual. So it runs perfectly in the local host but the IFC loader in in this does not load the ifc and gives an error like this:
VM7233:70054 wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'.
falling back to ArrayBuffer instantiation,
VM7233:70045 failed to asynchronously prepare wasm: CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 0d 0a 3c 21 @+0,
I have tried a lot of things to resolve this. I suspect it is because power bi is not able to access the .wasm files which are necessary to use the IFC loader from the library.