-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
arch-wasmWebAssembly architectureWebAssembly architecturearea-System.Runtime.InteropServices.JavaScriptos-browserBrowser variant of arch-wasmBrowser variant of arch-wasm
Milestone
Description
Given following in C#:
public static partial class Program
{
public static void Main () { }
[JSExport]
public static Task TestAsyncVoid () => Task.Delay(1);
}When invoking the method in node:
const runtime = await dotnet.withExitCodeLogging().withConfig(config).create();
await runtime.runMain("EntryAssembly.dll", []);
const exports = await runtime.getAssemblyExports("EntryAssembly.dll");
await exports.Program.TestAsyncVoid();
console.log("finished");— runtime exits without printing "finished" with the following log:
WASM EXIT undefined
WASM EXIT 0
Same story with async [JSImport]'s. Basically, any kind of concurrency doesn't work in node.
I've also tried testing with bun, but it behaved the same.
At the same time all this works fine in browser.
Is there something I'm missing? Maybe some kind of switch or option when creating the runtime?
Here is the repro (breaks on async calls in node, but works fine in browser): https://github.com/Elringus/JSInteropTest
.NET 8 RC1
NodeJS v20.5.1
Metadata
Metadata
Assignees
Labels
arch-wasmWebAssembly architectureWebAssembly architecturearea-System.Runtime.InteropServices.JavaScriptos-browserBrowser variant of arch-wasmBrowser variant of arch-wasm