3

This problem has been brought up a few times and I tried every suggested solution, but nothing helped.

What I have is a native module in a VS code extension. This works very well on Linux + Mac, but I cannot get it to load on Windows 10. Every time the extension is activated and tries to load the native module I get this error. What makes this so strange is that the native module works beautifully in a node session (in a Win command line). I checked what NodeJS version Visual Studio Code uses and installed exactly this version (x86, as vscode is still 32bit). I did an npm install npm -g, ran npm rebuild as well as normal node-gyp rebuild in my extension folder (or node module folder for node-gyp). Every time the module is built fine and works in a node session. Still I cannot get it to work in vscode. So I believe it must be something that has to do with the vscode app on Windows, just don't know what it is. For compilation I tried both VS 2013 and VS 2015.

Interesting here is also how node-gyp compiles the native module on Windows. It appears as if it uses a number of hacks, e.g. the compiled module crashs hard when using std::throw_with_nested (a C++11 feature). Another problem is the win_delay_load_hook.cc file, which contains a hack to make some weird situation work (this init fails on Win 10, so I had to disable that, this is a general DLL init problem not related to the vscode init). So it could well be it's just node-gyp on Win10 which is causing all the trouble. Yet, as I wrote, the native module works nicely in a node session.

What else could I do to find out what exactly is the problem? Is there a log file that shows exactly why the registration is not right? Is there a problem with vscode in general, on Windows 10?

Gama11
  • 31,714
  • 9
  • 78
  • 100
Mike Lischke
  • 48,925
  • 16
  • 119
  • 181
  • I'm facing exactly the same issue, The problem seems to be with VS Code because I can run the application by doing "node app.js". Did you solve the problem? Any clue? – Mauro Bilotti Feb 20 '18 at 14:42
  • Couldn't find anything. Meanwhile I gave up to write a native module (also read a suggestion from a vscode developer not use native modules). – Mike Lischke Feb 21 '18 at 07:58
  • In my case, works by deleting the ".vscode" folder. Tell me if that allowed you to re-run the application. – Mauro Bilotti Feb 21 '18 at 19:48

0 Answers0