nodejs / node

Node.js JavaScript runtime ✨🐢🚀✨
https://nodejs.org
Other
104.27k stars 28.06k forks source link

Compiler error running on Node 20.12 (works in 20.11.6) in napi-intl.h when calling napi_status napi_create_external_buffer #52754

Open mylowillem opened 2 weeks ago

mylowillem commented 2 weeks ago

Version

20.12

Platform

Windows and OSX

Subsystem

napi-intl.h

What steps will reproduce the bug?

Line 2680 in file napi-intl.h

How often does it reproduce? Is there a required condition?

always it's a compiler error

What is the expected behavior? Why is that the expected behavior?

The code compiles in node 20.11.2 so I expect it to compile in node 20.12

What do you see instead?

Severity Code Description Project Line Suppression State Details File Error C2664 'napi_status napi_create_external_buffer(napi_env,size_t,void ,node_api_nogc_finalize,void ,napi_value )': cannot convert argument 4 from 'void (__cdecl )(napi_env,void ,void ) noexcept' to 'node_api_nogc_finalize' binary_encoder 2680 C:\git\cloud\node_modules\node-addon-api\napi-inl.h

Additional information

Compiler errors on both OSX and Windows. Haven't tested on Linux

Severity Code Description Project Line Suppression State Details File Error C2664 'napi_status napi_create_external_buffer(napi_env,size_t,void ,node_api_nogc_finalize,void ,napi_value )': cannot convert argument 4 from 'void (__cdecl )(napi_env,void ,void ) noexcept' to 'node_api_nogc_finalize' binary_encoder 2680 C:\git\cloud\node_modules\node-addon-api\napi-inl.h

richardlau commented 2 weeks ago

cc @nodejs/node-api

KevinEady commented 2 weeks ago

Hi @mylowillem ,

Are you using NAPI_EXPERIMENTAL? If so, please check this comment on a similar issue: https://github.com/nodejs/node/issues/52229#issuecomment-2040131493 If not, please state the same here, and we'll look further.