Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
luojiandan_bi
Helper I
Helper I

[HELP]Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at...

I want to integration ACE Editor( https://ace.c9.io/ )   in PowerBI,but got error: 

error infoerror info

got warning in HTML: 

right statusright status

no warning in powerbi: 

wrong statuswrong status

2 REPLIES 2
bslzz
New Member

Hi. Were you able to fix this issue? I recently switched my angular project to use vite + esbuild and facing the same issue with ace-builds. I could not find any solutions to it yet.

dm-p
Super User
Super User

Hi @luojiandan_bi,

Because custom visuals are executed in sandboxed iframes, they have no origin and loading additional scripts via workers is not supported. I have spent a lot of time trying to integrate editors into visuals and the good ones all need to use workers - it's not possible to package the workers in a way that allows them to be loaded at execution time. Ace is not my first choice, and I hope to be able to use something else in time, but I have managed to integrate it and have it working for the JSON mode at least for now.

With Ace you have two options that can realistically work:

  1. Load the desired workers from a CDN without CORS restrictions at execution time (as again, the iframe sandbox means that a remote location has to allow requests from any domain).
  2. Use Ace with the useWorker: false property and import an appropriate completer. For JavaScript, I think you might need to use the ace-builds package, with ace-builds/src-noconflict/mode-javascript.js (and any others that might need to be included; I haven't worked with the JS syntax but I knwo that if you want search box and theme functionality you'll need to do something similar for any of these references)

As everyone's code is a little different it's hard to prescribe exactly what you need but hopefully this may give you some ideas. With Deneb I use jsoneditor, which includes Ace, but I'm really only taking advantage of its schema validation functionality, so I manually specify my own instance of Ace editor. As such I handle my dependent imports here, which may also help you figure it out for your case.

Good luck!

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors