-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrading from 0.8.20 to 0.9.6 #427
Comments
As an update. We managed to get version 0.9.6 running using the libnode libraries from here: https://github.com/alethic/Microsoft.JavaScript.LibNode/actions/runs/13220509513 But during testing the code inside the I have gone back to the latest nuget package before NodeJsPlatform was removed (0.9.3) a simple test works but when we run within a Azure Functions problem the first run works but then we get a "JS reference cannot be accessed from the current thread" error. I would really appreciate some help debugging the issues we are having. |
I'm pretty sure we are doing something wrong in terms of the interop with a stream we are intending to pass to the JavaScript. Our intention is to create a MemoryStream and have the JavaScript fill the stream with data. The .NET hosting code looks like this: What we want to do is pass a memory stream to the JS and have the JS fill the stream. Our code at the .NET end currently looks like this:
And the JavaScript being called looks like this:
I think we are probably going wrong when we create an instance of JSMarshaller and use this to wrap the MemoryStream. Could anyone please give us a hint at how this should be done? |
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:
initialize
function can be used only once.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 registerNodeJsEnvironment
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 aNodeEmbeddingThreadRuntime
viaplatform.CreateThreadRuntime();
and executesawait 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?
The text was updated successfully, but these errors were encountered: