NavigationError on NavigateTo

I needed to put this into OnInitialized rather than OnAfterRender, so had to go with the render-mode="Server" method, though apparently this isn't recommended.

It also states in the GitHub issue that this only happens in debug, not release, so a middle ground option is to change _Host.cshtml to contain:

<environment include="Staging,Production">
    <component render-mode="ServerPrerendered" type="typeof(App)" />
</environment>
<environment include="Development">
    <component render-mode="Server" type="typeof(App)" />
</environment>

There is an open issue on github for this problem. See also the preceeding issue where a possible workaround is mentioned: putting the NavigateTo method into OnAfterRender instead of OnInitialized.