fgilde / MudBlazor.Extensions

MudBlazor.Extensions from https://www.mudex.org is a small extension for MudBlazor from https://mudblazor.com
http://www.mudex.org
MIT License
245 stars 20 forks source link

[Bug]: Component JS loading does not respect App Base Path #67

Closed s-summers closed 11 months ago

s-summers commented 11 months ago

Contact Details

No response

What happened?

For an application with the app base path configured

When a page with a MudBlazor.Extensions component loads it does not include the path base Example: https://localhost:44354/_content/MudBlazor.Extensions/js/components/MudExSplitter.min.js

This is a problem for my deployed app as it runs into a CORS error.

I believe the issue is just a missing . prefix to make the path relative https://github.com/fgilde/MudBlazor.Extensions/blob/ddac23612f6c1844d6d14a07e8271310e94aa5d7/MudBlazor.Extensions/Helper/JsImportHelper.cs#L66-L69

Expected Behavior

component JS url path should include the configured path base

With a path base of /mybase/path/ Expected: https://localhost:44354/mybase/path/_content/MudBlazor.Extensions/js/components/MudExSplitter.min.js

Screenshots

No response

Reproduction link

No response

What application type are you referring to?

WebAssembly

Custom Application Type

No response

MudBlazor.Extension Version

1.7.77

MudBlazor Version

6.11.1

What browser are you using?

Chrome

Sample Solution

No response

Pull Request

No response

Code of Conduct

fgilde commented 11 months ago

Thanks for reporting this. I will have a look 👍

fgilde commented 11 months ago

Should be fixed in MudBlazor.Extensions 1.7.78 Nuget

If the adding '.' change is not enough for you, you can now also now specify your custom base path with

builder.Services.AddMudServicesWithExtensions(c => c.WithJsBasePath("/yourfolder/_content/"));