Skip to content

Blazor (server-side) ignores Path Base #9410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mashbrno opened this issue Apr 16, 2019 · 1 comment
Closed

Blazor (server-side) ignores Path Base #9410

mashbrno opened this issue Apr 16, 2019 · 1 comment
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug.

Comments

@mashbrno
Copy link

mashbrno commented Apr 16, 2019

On kestrel (and probably on IIS too - check #8368) is not possible to set application path. Using preview3.

Startup snippet:

public void Configure(IApplicationBuilder app)
{
	app.UsePathBase("/foo/");
	
	app.UseStaticFiles();
	app.UseRouting(routes =>
	{
		routes.MapRazorPages();
		routes.MapComponentHub<App>("app");
	});
}

correctly handles Razor Pages, but inside components there is an error:

Microsoft.AspNetCore.Components.Browser.Rendering.RemoteRenderer - Unhandled exception rendering component: 'Router' cannot find any component with a route for '/foo/bar', and no fallback is defined.
System.InvalidOperationException: 'Router' cannot find any component with a route for '/foo/bar', and no fallback is defined.
   at Microsoft.AspNetCore.Components.Routing.Router.Refresh()
   at Microsoft.AspNetCore.Components.Routing.Router.SetParametersAsync(ParameterCollection parameters)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.SetDirectParameters(ParameterCollection parameters)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewComponentFrame(DiffContext& diffContext, Int32 frameIndex)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewSubtree(DiffContext& diffContext, Int32 frameIndex)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InsertNewFrame(DiffContext& diffContext, Int32 newFrameIndex)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ComputeDiff(Renderer renderer, RenderBatchBuilder batchBuilder, Int32 componentId, ArrayRange`1 oldTree, ArrayRange`1 newTree)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)
   at Microsoft.AspNetCore.Components.Rendering.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
   at Microsoft.AspNetCore.Components.Rendering.Renderer.ProcessRenderQueue()
   at Microsoft.AspNetCore.Components.Rendering.Renderer.AddToRenderQueue(Int32 componentId, RenderFragment renderFragment)
   at Microsoft.AspNetCore.Components.RenderHandle.Render(RenderFragment renderFragment)
   at Microsoft.AspNetCore.Components.ComponentBase.StateHasChanged()
   at Microsoft.AspNetCore.Components.ComponentBase.CallOnParametersSetAsync()
@Eilon Eilon added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Apr 16, 2019
@mkArtakMSFT mkArtakMSFT added Components Big Rock This issue tracks a big effort which can span multiple issues area-blazor Includes: Blazor, Razor Components and removed Components Big Rock This issue tracks a big effort which can span multiple issues labels Apr 16, 2019
@mkArtakMSFT
Copy link
Member

Thanks for contacting us, @mashbrno.
We think this is fixed in the Preview4 release. If you will face this issue after upgrading to Preview4, please reopen this issue and we'll look into it further.

@mkArtakMSFT mkArtakMSFT added the bug This issue describes a behavior which is not expected - a bug. label Apr 17, 2019
@mkArtakMSFT mkArtakMSFT removed area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates labels May 9, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug.
Projects
None yet
Development

No branches or pull requests

3 participants