Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Can't use Plotly.Blazor if BlazorMonaco is installed in my Blazor App

$
0
0

In my Blazor app I'm using Plotly.Blazor for showing some graphs.
I have recently added BlazorMonaco, but once added - Plotly.Blazor stopped working.

In the DevTools console I get the following error:

Error: Microsoft.JSInterop.JSException: Cannot read properties of
undefined (reading 'newPlot') TypeError: Cannot read properties of
undefined (reading 'newPlot')
at Module.newPlot (https://localhost:5001/_content/Plotly.Blazor/plotly-interop.js:4:19)
at https://localhost:5001/_framework/blazor.server.js:1:3244
...

After exploring a bit:

  1. If I don't reference Monaco's_content/BlazorMonaco/lib/monaco-editor/min/vs/loader.js file, Plotly works just fine (but than of course Monaco wont work).
  2. When debugging Plotly's js it seems that window.Plotly is not defined.

My conclusion is that Monaco is probably polluting the global namespace, but I cannot find hard evidence for that...
Any suggestions how I can work around this issue?

Additional information:

  • BlazorMonaco: Version 3.2.0
  • Plotly.Blazor: Version 4.3.0

Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>