Skip to content

[NativeAOT-LLVM] DotnetJS JSExport fails, when function was defined in a Browser class library  #2626

Open
@maxkatz6

Description

@maxkatz6

Repro:

  1. Create browser class library, that is intended to be reused between Mono and NativeAOT-LLVM. Either .NET 8 or .NET 9.
  2. (Optional) Distribute it on nuget.
  3. Reference this library in NativeAOT-LLVM browser project.
  4. Use getAssemblyExports to execute exported method from JS.

Error message

MONO_WASM: Assert failed: Missing wasm export '_ClassLibrary__GeneratedInitializer__Register_' (for JSExport registration function in assembly 'ClassLibrary.dll') Error: Assert failed: Missing wasm export '_ClassLibrary__GeneratedInitializer__Register_' (for JSExport registration function in assembly 'ClassLibrary.dll')

Repro project:
ClassLibrary-2.zip

^ Note, ClassLibrary doesn't use the same runtime nugets, and is compiled with standard JSExport source generator.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-NativeAOT-LLVMLLVM generation for Native AOT compilation (including Web Assembly)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions