-
Notifications
You must be signed in to change notification settings - Fork 92
Description
Summary
WASM components produced by componentize-dotnet (.NET NativeAOT) fail at runtime when transpiled with jco for use in Node.js/V8.
Environment
- jco version: latest (Dec 2024)
- .NET versions tested: 8, 9, 10
- componentize-dotnet: latest
- Node.js: 20.x
- Platform: Linux
Error
When running the transpiled component in Node.js:
RuntimeError: null function or function signature mismatch
The .NET NativeAOT function tables fail to initialize properly in V8.
Steps to Reproduce
- Create a minimal .NET WASM component using componentize-dotnet
- Transpile with jco for Node.js
- Import and instantiate in Node.js
- Runtime crash occurs
What Was Tried
- jco transpilation with various flags
- Manual
_initialize()calls - Removing
[ThreadStatic]attribute from .NET code - Different .NET versions (8, 9, 10)
None resolved the issue.
Context
We're trying to support C#/.NET as a language option for WASM plugins in Signal K Server. Rust, AssemblyScript, and Go/TinyGo all work correctly with jco transpilation, but .NET does not.
The componentize-dotnet README states support for Wasmtime and WAMR runtimes, but doesn't mention jco/V8/Node.js compatibility.
Question
Is jco expected to work with .NET NativeAOT output from componentize-dotnet? If not, are there plans to support it, or is there a recommended workaround?