cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mdrabkin Frequent Visitor
Frequent Visitor

Is it possible to load WebAssembly file from custom visual?

Hi,

 

I'm experimenting with custom visuals development, and was trying to load a .wasm file.

Since it requires me to fetch the file, I keep getting cross origin error.

I couldn't find anywhere in the pbiviz.json a definition to include another resource in the packaging of the custom visual.

 

As a matter of fact, I couldn't even find a way to load any other blob, not even a regular image (all documentation guide to convert to data-url and use that)

 

Is there a way to package the .wasm file somehow, so that I'll be able to fetch it at runtime?

 

Thanks,

Maxim

3 REPLIES 3
Moderator v-viig
Moderator

Re: 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

pbicvsupport@microsoft.com

 

mdrabkin Frequent Visitor
Frequent Visitor

Re: Is it possible to load WebAssembly file from custom visual?

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

Moderator v-viig
Moderator

Re: Is it possible to load WebAssembly file from custom visual?

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

pbicvsupport@microsoft.com