cargo / napi-build
napi-build
What changed in napi-build 1 to 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-23.
4 breaking4 new APIs and options1 behavior and defaults1 tooling8 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initnapi-build 213 changes
Breaking changes 1
The required Rust version was bumped, affecting which Rust toolchain developers need to build the project.
New APIs and options 2
The MultiThread flavor is available on wasm32-wasip1-threads.
The build now exports emnapi_thread_crashed.
Behavior and default changes 1
napi symbols are loaded at runtime on all platforms using libloading.
Tooling 1
The CLI now supports non-threaded WASI targets.
Fixes and other changes 8
AsyncTask completion is guarded against environment teardown.
Outstanding async work is drained before a WASI binding is disposed.
Fixed linking wasm32-wasip1-threads with wasi-sdk 34 and Rust nightly.
Addons with live native code are no longer unloaded.
Non-Error rejections are preserved.
A wasm teardown barrier is added.
On OpenBSD, the linker flag works around a local thread storage destructor crash after DSO unloading.
Restores undefined symbols lookup behavior during builds.
napi-build 15 changes
Breaking changes 3
Task::compute now takes a mutable reference to self instead of an immutable reference.
The old module registration approach is replaced by the module_exports attribute on an init function.
Task::resolve now consumes self and takes Env by value rather than borrowing both.
New APIs and options 2
Module initialization uses the module_exports attribute on an init function that receives JsObject exports, optionally with Env.
Task gains a default reject method that returns the supplied error.