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

Edge-js: Uncaught Error: The specified procedure could not be found. \\? ... \edge_nativeclr.node #208

Closed
JDP124 opened this issue May 16, 2024 · 2 comments

Comments

@JDP124
Copy link

JDP124 commented May 16, 2024

Hi I wondered if you could take a look at the below, it seems I can't get Edge-js to run in my project.

I’m trying to use edge-js to run a .NET dll in a Typescript vscode LSP extension I’m working on. I have a local seperate Typescript project that successfully runs the dll using Edge-js. But can’t seem to get Edge-js to run because of this error:

adding a reference to edge.func()
const method = edge.func(filename);
edge.func("");

raises this error:
Uncaught Error Error: The specified procedure could not be found.
\?\c:{path to project}\node_modules\edge-js\lib\native\win32\x64\18.19.1\edge_nativeclr.node
at func (electron/js2c/node_init:2:2214)
at Module._extensions..node (internal/modules/cjs/loader:1356:18)
at func (electron/js2c/node_init:2:2214)
at Module.load (internal/modules/cjs/loader:1126:32)
at Module._load (internal/modules/cjs/loader:967:12)
at c._load (electron/js2c/node_init:2:13672)
at Module.require (internal/modules/cjs/loader:1150:19)
at require (internal/modules/cjs/helpers:119:18)
at (c:\VisualfilesSrc\V6.X\VSCScriptEditor\node_modules\edge-js\lib\edge.js:53:8)
at Module._compile (internal/modules/cjs/loader:1271:14)
at Module._extensions..js (internal/modules/cjs/loader:1326:10)
at Module.load (internal/modules/cjs/loader:1126:32)
at Module._load (internal/modules/cjs/loader:967:12)
at c._load (electron/js2c/node_init:2:13672)
at Module.require (internal/modules/cjs/loader:1150:19)
at require (internal/modules/cjs/helpers:119:18)
at (c:\VisualfilesSrc\V6.X\VSCScriptEditor\server\src\server.ts:47:1)
at Module._compile (internal/modules/cjs/loader:1271:14)
at Module._extensions..js (internal/modules/cjs/loader:1326:10)
at Module.load (internal/modules/cjs/loader:1126:32)
at Module._load (internal/modules/cjs/loader:967:12)
at c._load (electron/js2c/node_init:2:13672)
at executeUserEntryPoint (internal/modules/run_main:101:12)
at (internal/main/run_main_module:23:47)

The node module is indeed where it should be.

Node version : v20.11.0 I have tried Edge-js v21.7.2 and v22.1.1

The closest thing I could find online is this: Error: The specified module could not be found but this error is module not found, mine is procedure not found, not sure if relevant.

Looking into Edge.js file it seems the project is using Node v18.18.2, not sure if this is relevant, but my Typescript project that does run Edge-js without issue shows its running v20.11.0

determineVersion() = 18.19.1 process.versions.node = 18.18.2

Thanks in advance for any assistance

@JDP124 JDP124 changed the title Edge-js: Uncaught Error Error: The specified procedure could not be found. \\? ... \edge_nativeclr.node Edge-js: Uncaught Error: The specified procedure could not be found. \\? ... \edge_nativeclr.node May 16, 2024
@agracio
Copy link
Owner

agracio commented May 16, 2024

From the error it is looking for module in \?\c:{path to project}\node_modules\edge-js\lib\native\win32\x64\18.19.1\edge_nativeclr.node path which is incorrect. Could it have something to do with module packaging for VS Code?
c:\VisualfilesSrc\V6.X\VSCScriptEditor\node_modules\edge-js\lib\edge.js in error stack trace resolves to path without artefacts which is rather strange.
When using Node.js native modules in VS Code plugins do they have to be compiled to Node.js version or Electron version?
From what I can see in some GitHub issues it should be compiled as Electron native module, process.versions.node = 18.18.2 indicates Electron v28 try electron-edge-js instead.

Take a look at this answer: microsoft/vscode#658 (comment) and a couple below it. In you case you don't need to do any of that since electron-edge-js comes precompiled with correct headers, just make sure that path resolution for native module is correct.

EDIT: electron-edge-js does not support running in console, you would need to modify your test project to run Electron instead. https://github.com/agracio/electron-edge-js-quick-start

@JDP124
Copy link
Author

JDP124 commented May 16, 2024

Amazing, electron-edge-js runs. thank you.

@JDP124 JDP124 closed this as completed May 16, 2024
@JDP124 JDP124 reopened this May 16, 2024
@JDP124 JDP124 closed this as completed May 16, 2024
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

No branches or pull requests

2 participants