Skip to content

System.ArgumentException after conditional rendering is off #181

Description

@clutterloh

I'm using StandaloneCodeEditor in a conditional. It works fine, but anytime the conditional goes from on to off (It's toggle-able) I'm seeing ArgumentException in my console.

Example:

@if (showEditor)
{
    <StandaloneCodeEditor id="monaco-code-editor" @ref="monacoEditor" ConstructionOptions="EditorConstructionOptions" OnDidChangeModelContent="EditorContentChanged" />
}

Error:

Uncaught (in promise) Error: System.ArgumentException: There is no tracked object with id '8'. Perhaps the DotNetObjectReference instance was already disposed. (Parameter 'dotNetObjectId')
   at :5001/Microsoft.JSInterop.JSRuntime.GetObjectReference(Int64 dotNetObjectId)
   at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.BeginInvokeDotNet(:5001/JSRuntime jsRuntime, DotNetInvocationInfo invocationInfo, String argsJson)
    at w.endInvokeDotNetFromJS (blazor.server.js:1:4498)
    at Vt._invokeClientMethod (blazor.server.js:1:66680)
    at Vt._processIncomingData (blazor.server.js:1:64039)
    at rn.onreceive (blazor.server.js:1:57680)
    at WebSocket.<anonymous> (blazor.server.js:1:81773)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions