Skip to content
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

Usage on OS X + arm64 #211

Closed
coding-velociraptor opened this issue Feb 20, 2024 · 4 comments · Fixed by #226
Closed

Usage on OS X + arm64 #211

coding-velociraptor opened this issue Feb 20, 2024 · 4 comments · Fixed by #226

Comments

@coding-velociraptor
Copy link

Hey team,

Thank you for providing this library aiming to improve developer experience during NodeJS and C# interopability.

I'm trying to run it locally without success. For reproduction, I created this very simple repository. When I run the project node main.js, I get the following error message:

Unhandled Exception: System.ArgumentNullException: A runtime is required. Arg_ParamName_Name, runtime
   at Microsoft.JavaScript.NodeApi.JSValueScope..ctor(JSValueScopeType, JSRuntime.napi_env, JSRuntime, JSSynchronizationContext) + 0x450
   at Microsoft.JavaScript.NodeApi.JSValue.InvokeCallback[TDescriptor](JSRuntime.napi_env, JSRuntime.napi_callback_info, JSValueScopeType, Func`2) + 0x7c
   at Microsoft.JavaScript.NodeApi.JSValue.InvokeJSGetterNoContext(JSRuntime.napi_env, JSRuntime.napi_callback_info) + 0x70
[1]    70557 abort      node main.js

I tried node-api-dotnet/net8.0 and node-api-dotnet/net6.0, installing dotnet v6 and also "NODE_API_TRACE_HOST" like described in this issue

Here are some system information:

dotnet --version
> 8.0.201

# Installed using nvm.sh
node --version
> v18.19.0

Proc: Apple M1 Pro
OS: Sonoma 14.2.1

How might I fix this issue?

@coding-velociraptor coding-velociraptor changed the title Usage on Mac OS X arm64 Usage on OS X + arm64 Feb 20, 2024
@jasongin
Copy link
Member

@vmoroz Was this fixed by #222 ?

@coding-velociraptor
Copy link
Author

I updated to v0.5.8 and the new error message is:

/node-api-dotnet-simple/node_modules/node-api-dotnet/init.js:49
  dotnet = nativeHost.initialize(targetFramework, managedHostPath, require);
                      ^

Error: Failed to load managed host assembly. HRESULT: 0x80131621
    at initialize (/node_modules/node-api-dotnet/init.js:49:23)

@jasongin
Copy link
Member

@coding-velociraptor This is fixed in v0.5.10.

@vmoroz
Copy link
Member

vmoroz commented Mar 12, 2024

@coding-velociraptor , thank you for reporting the issue and for the repro simple repository!
It helped a lot to investigate the issue and to verify the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants