microsoft / microsoft/node-api-dotnet

panic trying to load Vite.createServer()

Offen
#426 2 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@vmoroz arbeitet bereits daran.

Seit 14.3.2025.

Vorherrschende Sprache
C#
Sterne
783
Forks
80
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Getting a panic trying to use RunAsync to import and invoke a JS method from a C# app using EmbeddingThreadRuntime/etc.

This is using the main branch as of today. The libnode itself was built by me.

thread '<unnamed>' panicked at C:\Users\runneradmin/.cargo\registry\src\index.crates.io-6f17d22bba15001f\napi-sys-2.4.0\src\functions.rs:7:3:
Node-API symbol has not been loaded
stack backtrace:
   0:     0x7ffcfa4265ec - napi_register_module_v1
   1:     0x7ffcfa3b9d9a - <unknown>
   2:     0x7ffcfa41d587 - napi_register_module_v1
   3:     0x7ffcfa427864 - napi_register_module_v1
   4:     0x7ffcfa427d71 - napi_register_module_v1
   5:     0x7ffcfa427912 - napi_register_module_v1
   6:     0x7ffcfa42789f - napi_register_module_v1
   7:     0x7ffcfa42788e - napi_register_module_v1
   8:     0x7ffcfa5fc091 - napi_register_module_v1
   9:     0x7ffcfa3d363b - napi_register_module_v1
  10:     0x7ffcfa3d35d7 - napi_register_module_v1

The problem is specifically limited to Vite.createServer right now. I can't figure out what it does internally to cause this. But my suspicion, thought I can't yet prove it, is that it loads a module which loads a module which loads a native module, which fails. Since I don't understand what's happening enough I haven't been able to create a reproduction.

Some enlightenment about what to look at may be useful. Is this a crash on the node side, because it's doing something truly awful, or is it some interaction with NodeAPI?

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.