-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
Needs: Author FeedbackThe author of this issue needs to respond in order for us to continue investigating this issue.The author of this issue needs to respond in order for us to continue investigating this issue.Needs: ReproIndicates that the team needs a repro project to continue the investigation on this issueIndicates that the team needs a repro project to continue the investigation on this issueStatus: No Recent Activityarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Since .NET 10 Preview 4, where NavigationManager.NavigateTo no longer throws a NavigationException, NavigateTo no longer has any effect in SSR mode, if called after an aynchronous method call in OnInitializedAsync.
Expected Behavior
NavigationManager.NavigateTo navigates to the specified route.
Steps To Reproduce
Doesn't work:
@inject NavigationManager NavigationManager
@code {
protected override async Task OnInitializedAsync()
{
await Task.Delay(1000);
NavigationManager.NavigateTo("any-route"); //Does nothing
}
}
Works correctly:
@inject NavigationManager NavigationManager
@code {
protected override async Task OnInitializedAsync()
{
NavigationManager.NavigateTo("any-route"); //Works correctly
await Tasl.Delay(1000);
}
Exceptions (if any)
No response
.NET Version
10.0.100-preview.5.25277.114
Anything else?
No response
Metadata
Metadata
Assignees
Labels
Needs: Author FeedbackThe author of this issue needs to respond in order for us to continue investigating this issue.The author of this issue needs to respond in order for us to continue investigating this issue.Needs: ReproIndicates that the team needs a repro project to continue the investigation on this issueIndicates that the team needs a repro project to continue the investigation on this issueStatus: No Recent Activityarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components