Skip to content
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

[browser][MT] .NET 9 regression of sync interop #111098

Open
elringus opened this issue Jan 5, 2025 · 1 comment
Open

[browser][MT] .NET 9 regression of sync interop #111098

elringus opened this issue Jan 5, 2025 · 1 comment
Labels
arch-wasm WebAssembly architecture area-System.Runtime.InteropServices.JavaScript untriaged New issue has not been triaged by the area owner

Comments

@elringus
Copy link

elringus commented Jan 5, 2025

Description

In .NET 8 it was possible to use sync/blocking interop in MT mode without any restrictions. For example, here is a sample which uses threading and nested sync interop for both JSImport and JSExport and works fine in .NET 8: https://github.com/elringus/bootsharp/tree/v0.3.3/samples/react

This same use case is no longer possible in .NET 9 (https://github.com/elringus/bootsharp/tree/main/samples/react)

Even with:

dotnet.withConfig({
    jsThreadBlockingMode: "DangerousAllowBlockingWait"
});

— it still throws when attempting to invoke sync JS function from within a sync JSExport.

Given this worked fine in .NET 8, it appears to be a regression. I'm fine with any kind of opt-in "dangerous" switches and "use at your own risk" contexts, but please restore the functionality .NET 8 had.

Reproduction Steps

  1. Clone https://github.com/elringus/bootsharp/tree/main/samples/react
  2. Follow instructions on https://github.com/elringus/bootsharp/blob/main/samples/react/README.md
  3. Observe the errors about sync interop
  4. Now clone the same repo, but under v0.3.3 tag, which runs on .NET 8
  5. Follow same instructions
  6. Observe no errors

Expected behavior

The sample should work on both .NET 8 and .NET 9

Actual behavior

The sample throw errors on .NET 9

Regression?

This is a regression in .NET 9

Known Workarounds

None.

Configuration

No response

Other information

No response

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jan 5, 2025
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Jan 5, 2025
@jeffschwMSFT jeffschwMSFT added the arch-wasm WebAssembly architecture label Jan 6, 2025
Copy link
Contributor

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

@vcsjones vcsjones removed the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-wasm WebAssembly architecture area-System.Runtime.InteropServices.JavaScript untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

3 participants