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
I was trying to use this interesting project with the official node-addon-api C++ API. However, when compiling I get errors like em++: error: undefined exported symbol: "napi_register_module_v1" [-Wundefined] [-Werror], which means the Node Addon function is not exported. Is there a CMake example that makes it possible to use this library?
When building for wasm, Node's C++ headers definenapi_register_wasm_v1 instead, so you should add that to the exported functions instead of napi_register_module_v1. For a C++ example, see Parcel's watcher.
Activity
devongovett commentedon Jul 6, 2025
When building for wasm, Node's C++ headers define
napi_register_wasm_v1instead, so you should add that to the exported functions instead ofnapi_register_module_v1. For a C++ example, see Parcel's watcher.