SAP / node-rfc

Asynchronous, non-blocking SAP NW RFC SDK bindings for Node.js
Apache License 2.0
252 stars 74 forks source link

Not so easy to use in VSCode or Electron #94

Closed Mabenan closed 5 years ago

Mabenan commented 5 years ago

Hi,

after a day of screaming i finally found the reason why this module doesn't run out of the box with VSCode. The Reason here is that it has to be build with node_module_version 69 or higher. That maybe sounds easy but the problem here is that there is no Node Version with this ABI Version the reason for this can be found here https://github.com/nodejs/TSC/issues/651.

So the easy solution seams to be to compile against ABI Version 72 which is Node Version 12.6.0. This works fine but if you try it the following way

npm install node-rfc@v1.0.0-rc10 --build-from-source

It generates the binding folders with the ABI version. Which results in the folder win32-x64-node-v72

This folder won't be found at runtime because the module loader searches for the folder win32-x64-node-v72

A solution for this could be to still generate the folders with version but also generate a folder that doesn't have a version and can be use as fallback in sapnwrfc-client.ts

bsrdjan commented 5 years ago

Could you please explain what is exactly not running out of the box, because VSCode users (including me) did not report the issue so far? Also the folder name win32-x64-node-v72 is identical in comment below:

It generates the binding folders with the ABI version. Which results in the folder win32-x64-node-v72

This folder won't be found at runtime because the module loader searches for the folder win32-x64-node-v72

The node-rfc is built for LTS releases and their corresponding ABI versions. The latest node-rfc release includes the v72 binaries as well, what is exactly missing?

Mabenan commented 5 years ago

Sorry, it should have been that way.

It generates the binding folders with the ABI version. Which results in the folder win32-x64-node-v72

This folder won't be found at runtime because the module loader searches for the folder win32-x64-node-v69

The concrete error is when i want to use the node-rfc lib in an vscode extension. This is because VSCode uses his own node processor.

When i change the v72 manually into v69 it works perfectly fine. It also works with the pull request.

bsrdjan commented 5 years ago

I would not merge the workaround into node-rfc, for fixing (hopefully temporary) gap in Electron vs-code extension. Thank you very much for the pull request helping other Electron extension users fix the issue.