Skip to content

Assert Node-API version of the Cargo.toml #312

@kraenhansen

Description

@kraenhansen

We're still lacking implementation of some Node-API runtime functions. For the time being, it would be great if we inspected the Cargo.toml and provide a neat explanation if the developer is building for a version of Node-API we don't currently support.

The alternative is aborts at runtime, similar to:

[DEBUG] [NodeApiHost] [pshenmic-dpp-napi--dpp] Loading addon by '@rpath/pshenmic-dpp-napi--dpp.framework/pshenmic-dpp-napi--dpp'
[DEBUG] [NodeApiHost] [pshenmic-dpp-napi--dpp] Loaded addon
[DEBUG] [NodeApiHost] [pshenmic-dpp-napi--dpp] Found napi_register_module_v1 (0x103a09294)
Node-API function 'napi_create_threadsafe_function' called before it was injected!

The workaround is to downgrade the Node-API version declared in your Cargo.toml as per the ferric-example.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions