Forum Discussion
Load React component inside power BI - Failed to construct 'Worker'
- 7 months ago
Hi,
This behavior is expected due to the Power BI custom visual sandboxing model. Custom visuals run inside a sandboxed iframe with an opaque origin (origin = 'null'). Because of that, creating a Web Worker from a URL like https://app.powerbi.com/.../worker.js fails the browser’s origin checks, which is why you see:
Failed to construct 'Worker' ... cannot be accessed from origin 'null'
So to your question: loading a separate worker.js file by URL is effectively restricted in Power BI Service and isn’t something the visual can override.
Workable alternatives are:
Bundle the worker and create it via a Blob URL (or bundler-supported worker import), instead of loading worker.js as a hosted script.
If the worker is mainly for heavy compute, consider moving the processing outside the visual (backend/Fabric) or running the WASM on the main thread if feasible.
In short: Power BI is unlikely to allow externally loaded worker scripts, so the practical solution is to inline/bundle the worker rather than fetch it as a separate file.
Hi keerthanabasa ,
Thank you mohit_sakhare for the response provided!
Has your issue been resolved? If the response provided by the community member addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone.
Thank you.
- v-tejrama7 months agoCommunity Support
Hi keerthanabasa ,
I wanted to follow up and see if you had a chance to review the information shared. If you have any further questions or need additional assistance, feel free to reach out.
Thank you.