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
Thank you very much for the response!
Yes I know that loading external resources will require the server to enable CORS.
As the visual is served from app.powerbi.com, I would need to configure powerbi to enable CORS. Is that possible?
Also if there is a way to host the visual ourselves, do you know where I could find some information about it?
Thanks,
Maxim
- v-viig8 years agoCommunity Champion
We can not control CORS in Power BI. However, you can upload your wasm files to CDN or another server that supports CORS.
What do mean? Do you want to use a visual outside of Power BI?
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
- TienSinh3 years agoFrequent Visitor
I created a local server on my machine that hosts the .wasm file, but when I try to fetch it from the power bi visual project, it caused an error about CSP `because it violates the following Content Security Policy directive: "default-src <URL> data: blob: 'unsafe-inline' 'unsafe-eval'". Note that 'connect-src' was not explicitly set, so 'default-src' is used as a fallback.` How can I fix this, please help me !!