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
My native addons CIs started failing after the 1.7.0 release. It looks like even the hello world project is broken with 1.7.0.
I get errors like:
> node-gyp rebuild
make: Entering directory '/home/tsviatko/work/node-addon-examples/1_hello_world/node-addon-api/build'
CXX(target) Release/obj.target/hello/hello.o
In file included from ../hello.cc:1:0:
/home/tsviatko/work/node-addon-examples/1_hello_world/node-addon-api/node_modules/node-addon-api/napi.h:1960:49: error: expected ‘)’ before ‘tsFunctionValue’
ThreadSafeFunction(napi_threadsafe_function tsFunctionValue);
^~~~~~~~~~~~~~~
/home/tsviatko/work/node-addon-examples/1_hello_world/node-addon-api/node_modules/node-addon-api/napi.h:2023:25: error: ‘napi_threadsafe_function_call_mode’ has not been declared
napi_threadsafe_function_call_mode mode) const;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tsviatko/work/node-addon-examples/1_hello_world/node-addon-api/node_modules/node-addon-api/napi.h:2030:21: error: ‘napi_threadsafe_function’ was not declared in this scope
std::unique_ptr<napi_threadsafe_function> _tsfn;
^~~~~~~~~~~~~~~~~~~~~~~~```
when building it.
I have the same issue with Node.js version 10.5.2 when I run npm install --build-from-source microtime. It used to work before release 1.7.0 of node-addon-api.
Hi everyone,
I think that I've found the problem. The thread_safe_function is considered stable starting from N-API version 4 and in all the LTS 12.6.0 , 10.16.0 and 8.16.0 it compile well. So what we need is to add a control on the version of N-API if the version is greater than 3 we can enable the Napi::ThreadSafeFunction . @mhdawson@gabrielschulhof @nodejs/n-api Could someone confirm this and take a look at this PR #518 ?
Hi everyone,
we prepared a patch. Now we are testing on CI and then we will make a new release. Sorry for the inconvenience and thank you for your quickly feedback.
Hi everyone we just published the version 1.7.1 that should solve the problem. I'm closing the issue feel free to reopen in case you will experiment the same problem.
hi everyone,
I'm not able to use Napi::ThreadSafeFunction.
I'm using cmake-js and the compilation gives me this output: no type named 'ThreadSafeFunction' in namespace 'Napi'
Activity
NickNaso commentedon Jul 23, 2019
Hi @codemerx,
which is the Node.js version that give you the problem?
iamstolis commentedon Jul 23, 2019
I have the same issue with Node.js version
10.5.2when I runnpm install --build-from-source microtime. It used to work before release1.7.0ofnode-addon-api.tirumala-01 commentedon Jul 23, 2019
I see the same issue with node version
8.10.0as well.drunewin commentedon Jul 23, 2019
1.7.0seems like it may include breaking changes?It breaks the build for this dependent module: ranisalt/node-argon2#192
drunewin commentedon Jul 23, 2019
Anyone have a workaround? This a dependency of a dependency for my project and it is blocking some build pipelines.
NickNaso commentedon Jul 23, 2019
Hi everyone,
I think that I've found the problem. The
thread_safe_functionis considered stable starting from N-API version 4 and in all the LTS12.6.0,10.16.0and8.16.0it compile well. So what we need is to add a control on the version of N-API if the version is greater than 3 we can enable theNapi::ThreadSafeFunction.@mhdawson @gabrielschulhof @nodejs/n-api Could someone confirm this and take a look at this PR #518 ?
NickNaso commentedon Jul 23, 2019
@codemerx Thanks for your feedback.
NickNaso commentedon Jul 23, 2019
Hi everyone,
we prepared a patch. Now we are testing on CI and then we will make a new release. Sorry for the inconvenience and thank you for your quickly feedback.
NickNaso commentedon Jul 23, 2019
Hi everyone we just published the version
1.7.1that should solve the problem. I'm closing the issue feel free to reopen in case you will experiment the same problem.pome90 commentedon Aug 5, 2019
hi everyone,
I'm not able to use
Napi::ThreadSafeFunction.I'm using
cmake-jsand the compilation gives me this output:no type named 'ThreadSafeFunction' in namespace 'Napi'This is my environment configuration:
mhdawson commentedon Aug 14, 2019
@pome90 if this is still an issue please open a new issue as this one is closed.