You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: The require function was not found on the global node_api_dotnet object. Set `global.node_api_dotnet.require` before loading the module.
at Microsoft.JavaScript.NodeApi.Interop.JSRuntimeContext.get_RequireFunction() + 0x35f
at Microsoft.JavaScript.NodeApi.Interop.JSRuntimeContext.<>c__DisplayClass51_0.<Import>b__0(ValueTuple`2 _) + 0x1c4
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey, Func`2) + 0xdf
at Microsoft.JavaScript.NodeApi.Interop.JSRuntimeContext.Import(String, String, Boolean) + 0xd7
at Microsoft.JavaScript.NodeApi.Interop.JSRuntimeContext.<>c__DisplayClass51_0.<Import>b__0(ValueTuple`2 _) + 0x33e
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey, Func`2) + 0xdf
at Microsoft.JavaScript.NodeApi.Interop.JSRuntimeContext.Import(String, String, Boolean) + 0xd7
at Microsoft.JavaScript.NodeApi.Interop.NodeStream.CreateProxy(Stream) + 0x5a
at Microsoft.JavaScript.NodeApi.Interop.JSRuntimeContext.<>c__DisplayClass37_0`1.<GetOrCreateObjectWrapper>b__0() + 0x43
at Microsoft.JavaScript.NodeApi.Interop.JSRuntimeContext.GetOrCreateObjectWrapper[T](T, Func`1) + 0xd6
at Microsoft.JavaScript.NodeApi.Interop.JSRuntimeContext.GetOrCreateObjectWrapper[T](T) + 0x8d
at Microsoft.JavaScript.NodeApi.Generated.Module.MyModule_Class1_HelloStream(JSCallbackArgs __args) + 0xa5
at MyModule!<BaseAddress>+0x145159
at Microsoft.JavaScript.NodeApi.JSValue.InvokeCallback[TDescriptor](JSRuntime.napi_env, JSRuntime.napi_callback_info, JSValueScopeType, Func`2) + 0x1bc
at Object.<anonymous> (C:\Users\User\project\index.js:5:37)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
error Command failed with exit code 1.
I was able to fix it by adding global.node_api_dotnet = { require } before requiring the module, but this feels like a hack - am I doing something wrong?
The text was updated successfully, but these errors were encountered:
I tried a simple example to test out using streams:
Oddly, this throws an error:
This is the error:
I was able to fix it by adding
global.node_api_dotnet = { require }
before requiring the module, but this feels like a hack - am I doing something wrong?The text was updated successfully, but these errors were encountered: