Skip to content

[Blazor] Error is thrown when component has been disposed before invoking a method from the client-side #14923

@jivanova

Description

@jivanova

Related to #11641

Describe the bug

There is no tracked object with id '//'. Perhaps the DotNetObjectRef instance was already disposed.

When a component has asynchronous client-side logic, sometimes the disposal occurs prior to the invoke of a server method and the error is thrown. The issue is related to more complex scenarios, but I have isolated it in the simplest reproducible project.

To Reproduce

Repo https://github.com/jivanova/DotNetObjectRef-Error

All steps described there.

Expected behavior

To be able to track whether the instance has been disposed and prevent further triggering of methods.

I have tried to call js dispose function to keep the info that the dotnetinstance has been disposed, but it's not stable solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions