Skip to content

Blazor JS Interop is bugged in an hard to reproduce scenario. #44927

@Kuinox

Description

@Kuinox

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

On firefox, my odd setup (vite.js serving blazor and ts files), sometimes trigger an error.
While I have not pinpointed the cause, it trigger a bug here:

https://github.com/dotnet/aspnetcore/blob/main/src/JSInterop/Microsoft.JSInterop.JS/src/src/Microsoft.JSInterop.ts#L74

here document.baseURI can return an URI with a hash, making the concatenation on the hash instead of the path part of the URI. When importing files, the hash is truncated.
This lead to this:
image

Expected Behavior

The concatenation works and this function successfuly import the file.

Steps To Reproduce

N/A don't know how to reproduce, happens randomly

Exceptions (if any)

No response

.NET Version

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-blazorIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.feature-blazor-jsinteropThis issue is related to JSInterop in Blazorgood first issueGood for newcomers.help wantedUp for grabs. We would accept a PR to help resolve this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions