serdarciplak / BlazorMonaco

Blazor component for Microsoft's Monaco Editor which powers Visual Studio Code.
https://serdarciplak.github.io/BlazorMonaco/
MIT License
441 stars 99 forks source link

Does this work with Blazor Server? #42

Closed jmuronis closed 1 year ago

jmuronis commented 3 years ago

Does this work with Blazor Server? I tried and no matter where I put the script tags I either get an error or if I get rid of the error, then page navigation stops working.

TheNameIsDono commented 3 years ago

I got it working by putting the scripts last in the chain, under the _framework/blazor.server.js. Using NETCore 3.1

MariaCobretti commented 2 years ago

I am getting a null reference exception

Unhandled exception rendering component: Object reference not set to an instance of an object. System.NullReferenceException: Object reference not set to an instance of an object. at BlazorMonaco.MonacoEditor.OnAfterRenderAsync(Boolean firstRender)

MariaCobretti commented 2 years ago

got to add options

43

QianMoXi commented 1 year ago

Because static IJSRuntime is used in the JsRuntimeExt , It cannot be used on Blazor Server, otherwise it will cause data spoofing when multiple people open the editor

serdarciplak commented 1 year ago

98 fixes the static IJSRuntime issue and it should now be compatible with server-side apps. To sum up, server-side apps does not use the static instance but expects the app to provide an instance when one is needed.

Let me know if there are any other issues.