You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue with Blazor wasm where non-primitive (class and struct) arguments passed through JSInterop are failing to be parsed with EndOfStringNotFound exception for both cases where arguments are passed from dotnet to JS and from JS to dotnet. However, this issue appears to be environment dependent, as it's only reproduceable on our machines in France and only with AoT compilation enabled. Without AoT compilation no issue is present.
Expected Behavior
Arguments should be passed successfully between JS and dotnet.
Make sure wasm tools are installed via running "dotnet workload install wasm-tools-net8".
Publish the project to a desired folder.
Host the project via IIS Manager. Here's my settings example:
Open the hosted website in the browser and observe console via F12. I believe this issue depends on the environment, so it might work as expected on your machine. If everything is fine you should see a console log like "guid - string" appear in the console when mouse cursor leaves the website. If not, you should see an exception similar to the one in the Exceptions section below.
Exceptions (if any)
When passing arguments from dotnet to JS:
I believe there is some code in Blazor.Start() JS method that invokes JSInterop and passes arguments from dotnet to JS.
When passing arguments from JS to dotnet:
In this case there are 2 arguments: Guid and string, that are being passed from JS to dotnet.
.NET Version
8.0.11
Anything else?
Environment:
ASP.NET Core shared framework version 8.0.11
Microsoft .NET Windows Server Hosting version 8.0.11
Publishing the project without AoT seem to fix the issue, so the root of this issue might be related to AoT compilation.
Please let me know if you need any more information.
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Describe the bug
I encountered an issue with Blazor wasm where non-primitive (class and struct) arguments passed through JSInterop are failing to be parsed with EndOfStringNotFound exception for both cases where arguments are passed from dotnet to JS and from JS to dotnet. However, this issue appears to be environment dependent, as it's only reproduceable on our machines in France and only with AoT compilation enabled. Without AoT compilation no issue is present.
Expected Behavior
Arguments should be passed successfully between JS and dotnet.
Steps To Reproduce
Example project: https://github.com/Kizuto3/Blazor-JavaScript-Interop
Steps:
Make sure wasm tools are installed via running "dotnet workload install wasm-tools-net8".
Publish the project to a desired folder.
Host the project via IIS Manager. Here's my settings example:
Open the hosted website in the browser and observe console via F12. I believe this issue depends on the environment, so it might work as expected on your machine. If everything is fine you should see a console log like "guid - string" appear in the console when mouse cursor leaves the website. If not, you should see an exception similar to the one in the Exceptions section below.
Exceptions (if any)
When passing arguments from dotnet to JS:
I believe there is some code in Blazor.Start() JS method that invokes JSInterop and passes arguments from dotnet to JS.
When passing arguments from JS to dotnet:
In this case there are 2 arguments: Guid and string, that are being passed from JS to dotnet.
.NET Version
8.0.11
Anything else?
Environment:
ASP.NET Core shared framework version 8.0.11
Microsoft .NET Windows Server Hosting version 8.0.11
Publishing the project without AoT seem to fix the issue, so the root of this issue might be related to AoT compilation.
Please let me know if you need any more information.
The text was updated successfully, but these errors were encountered: