realm-js icon indicating copy to clipboard operation
realm-js copied to clipboard

Assert NAPI version at runtime

Open kraenhansen opened this issue 1 year ago • 0 comments

We've seen users experience the following error, when importing our package on outdated versions of Node.js:

undefined symbol: napi_add_finalizer

While we declare our supported engines in our package.json, users have experienced this when zip'ing up the package and uploading it to AWS Greengrass / Lambdas. We could check the version of NAPI at runtime to verify that we're indeed running on a supported Node.js version, to avoid runtime errors or crashes when loading our native module.

The NAPI version is available via:

process.versions.napi

kraenhansen avatar May 03 '23 10:05 kraenhansen