diff --git a/src/Components/Web/src/Routing/NavigationLock.cs b/src/Components/Web/src/Routing/NavigationLock.cs index e8b5566531de..622ab43a1865 100644 --- a/src/Components/Web/src/Routing/NavigationLock.cs +++ b/src/Components/Web/src/Routing/NavigationLock.cs @@ -107,7 +107,14 @@ async ValueTask IAsyncDisposable.DisposeAsync() if (_confirmExternalNavigation) { - await JSRuntime.InvokeVoidAsync(NavigationLockInterop.DisableNavigationPrompt, _id); + try + { + await JSRuntime.InvokeVoidAsync(NavigationLockInterop.DisableNavigationPrompt, _id); + } + catch (JSDisconnectedException) + { + // If the browser is gone, we don't need it to clean up any browser-side state + } } } }