Closed mateusz-plociennik closed 1 month ago
I commented out the include in https://github.com/mmomtchev/swig/blob/cd411c4edff7ab523943be883b4ea2d18cee395c/Lib/javascript/napi/javascriptruntime.swg#L35 and that works for me, so maybe that should be included conditionally for WASM?
uv.h
is part of the Node.js distribution and it must be in the same directory as node_api.h
. If it is missing, you have a problem with your Node.js distribution. emnapi
overrides it with its own version.
I think I am facing the issue with cmake-js
you mentioned here.
If I remove "binary": {"napi_versions": [7]}
from package.json
, then I get
-DCMAKE_JS_INC=/Users/mateuszp/.cmake-js/node-arm64/v22.4.1/include/node
otherwise:
-DCMAKE_JS_INC=/opt/homebrew/lib/node_modules/cmake-js/node_modules/node-api-headers/include;/Users/mateuszp/Developer/sw/AppiumDriver/node_modules/node-addon-api
According to https://github.com/nodejs/node-addon-api/blob/main/doc/README.md#abi-stability-guideline
It is important to remember that other Node.js interfaces such as libuv (included in a project via #include
) are not ABI-stable across Node.js major versions.
The generated SWIG code doesn't seem to use any of uv_*
API, so why do we need to include it? Is it required for async?
How does the include of node_api.h
work then?
Through node-api-headers
package:
> tree /opt/homebrew/lib/node_modules/cmake-js/node_modules/node-api-headers/include
/opt/homebrew/lib/node_modules/cmake-js/node_modules/node-api-headers/include
├── js_native_api.h
├── js_native_api_types.h
├── node_api.h
└── node_api_types.h
Hi, I am trying out current main branch (as of 15/07/2024). I am trying your fork to get smart pointers support. It seems there's a strong libuv dependency, which I am trying to sort out. I decided to go with cmake-js build and I am using UseSWIG macros. I use
-c++ -javascript -napi
args. I am getting the following error:What is the best approach to get pass this error? Should I include emnapi?