Multiple NodeJsEnvironments

Aperta
#427 6 commenti 2 reazioni 1 assegnatario Vedi su GitHub

@vmoroz ci sta già lavorando.

Dal 14/3/2025.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

We had a project that was performing interop from .NET to JS using version 0.8.20 but were getting a couple of intermittent errors when trying to run outside of our development environment.

The two errors we are getting are:

  1. Already initialized. The initialize function can be used only once.
  2. The JS reference cannot be accessed from the current thread.

We tried to resolve this by updating to the latest nuget packages but it looks like there have been some breaking changes and the docs are no longer up-to-date.

We are using DI and used to store NodeJsPlatform as a singleton and register NodeJsEnvironment as scoped and pass this into another scoped service that executes some JavaScript to render a PDF report.

We have now replaced this with NodeEmbeddingPlatform as a singleton which is passed into the scoped report generation service which then creates a NodeEmbeddingThreadRuntime via platform.CreateThreadRuntime(); and executes await threadRuntime.Run(async () =>...

With the latest code when trying to create the NodeEmbeddingPlatform we get the following error:

"System.EntryPointNotFoundException : Unable to find an entry point named 'node_embedding_platform_create' in DLL."

Could someone please give us some hints as to how to get the latest version working and any pointers as to what our initial issues may be related to?

Lingua principale
C#
Stelle
783
Fork
80
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/node-api-dotnet

Tutte le issue di microsoft/node-api-dotnet

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.