BlazorMonaco icon indicating copy to clipboard operation
BlazorMonaco copied to clipboard

Does this work with Blazor Server?

Open jmuronis opened this issue 3 years ago • 3 comments

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.

jmuronis avatar May 04 '21 15:05 jmuronis

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

TheNameIsDono avatar May 07 '21 08:05 TheNameIsDono

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 avatar Feb 28 '22 15:02 MariaCobretti

got to add options

#43

MariaCobretti avatar Feb 28 '22 15:02 MariaCobretti

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

QianMoXi avatar Jun 06 '23 08:06 QianMoXi

#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.

serdarciplak avatar Aug 19 '23 19:08 serdarciplak