Rendering error inside IDE

I have this annoying error all the time when using the page editor in a .Net 8 WebAssembly application. There are many threads suggesting that this specific error is because Radzen.Blazor.js is not imported correctly. But all those threads refer to it in a running application, which does work fine for me. The issue is right inside the IDE and I can't just debug the IDE to find the root cause.

Hi @Paul_Suckow,

Is this application created by Radzen Blazor Studio? I am asking because we haven't seen this error before. It would mean that the required JS files are either not registered or Radzen Blazor Studio fails to recognize them.

Yes it was generated by Radzen (.Net 8 WebAssembly).

Seems to work fine here:

Can you send us the application to info@radzen.com? Upload it to some cloud storage (dropbox, google drive etc.) and share a download link with us.

I have reproduced this bug in an example application and send it to info@radzen.com.

I still don't know what exactly causes this bug, because it only happens in some situations that I cannot define. But It mostly happend as soon as I switched the rendermode to new InteractiveWebAssemblyRenderMode(prerender: false) in App.razor.

I have found the cause of the problem. In App.razor you have this:

<script 
    src="_content/Radzen.Blazor/Radzen.Blazor.js?v=@(typeof(Radzen.Colors).Assembly.GetName().Version)"></script>

(note there is a new line before the src attribute). This breaks our script detection feature and as a result the Radzen.Blazor.js file is not loaded.

Changing it to:

<script src="_content/Radzen.Blazor/Radzen.Blazor.js?v=@(typeof(Radzen.Colors).Assembly.GetName().Version)"></script>

(without a new line before the src attribute) fixes the problem:

Oh wow, this actually makes sense. When looking back, it always happend when editing App.razor with VS Code, in which I have "Format On Save" enabled.

I hope this is something you can fix, because this seems like a resonable thing todo. Thanks a lot!