Skip to content

.NET NativeAOT WASM output fails with "null function or function signature mismatch" when transpiled for Node.js #1173

@dirkwa

Description

@dirkwa

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

  1. Create a minimal .NET WASM component using componentize-dotnet
  2. Transpile with jco for Node.js
  3. Import and instantiate in Node.js
  4. 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?

References

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions