New-UDCodeEditor compare and highlighting not working

Product: PowerShell Universal
Version: 1.5.20

Syntax hightliging and the compare function of the new-udcodeeditor is not working for us. All i can see is that editor.worker.js is an html file

What can we do to solve this problem?

Can you share a PS snippet of how you are creating the code editor?

New-UDCodeEditor -id "editor" -Language json -Height '80ch' -Code $($File.Content) -Theme vs-dark -MouseWheelZoom

The code for the page looks like this

New-UDPage -Name "pagename" -Url "/pagename/:Type" -Role "role1","role2" -Endpoint {
    [snip]
    New-UDElement -tag 'div' -Endpoint {
        [snip]
        New-UDCodeEditor -id "editor" -Language json -Height '80ch' -Code $($File.Content)
        [snip]
    }
    [snip]
}

the removed snippets are mainly peaces of code that prepare the data that is presented in the codeeditor

It does look like that JS error is causing this. I’m not having this problem myself. It almost seems like it’s failing to find that file. It’s serving the HTML file because it failed to find an asset at that location on disk (or at least it thinks so).

How are you hosting this?

We are hosting this on azure, and the problem also has been found.

We redirected the datafolder, but we had not properly added the components. After changing -Component on New-PSUDashboard and setting a hard path to the datafolder, all is good now.

1 Like