diff --git a/src/Components/Web/src/Routing/NavigationLock.cs b/src/Components/Web/src/Routing/NavigationLock.cs index e8b5566531de59f27954f8ca584ba2d261509415..622ab43a18656866e5d5cbcfd2c3522cfd6e7ef0 100644 --- a/src/Components/Web/src/Routing/NavigationLock.cs +++ b/src/Components/Web/src/Routing/NavigationLock.cs @@ -107,7 +107,14 @@ public sealed class NavigationLock : IComponent, IHandleAfterRender, IAsyncDispo 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 + } } } }