Description
Setting NAPI_RS_FORCE_WASI=false as an environment variable causes lancedb to attempt loading the non-existent lancedb.wasi.cjs file, resulting in initialization failure.
Error
initialization deferred: ENOENT: no such file or directory, open '.../@lancedb/lancedb/dist/lancedb.wasi.cjs'
Root Cause
In native.js around line 607:
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI)
The string "false" is truthy in JavaScript, so NAPI_RS_FORCE_WASI=false inadvertently triggers the WASI loading path.
Expected Behavior
NAPI_RS_FORCE_WASI=false should NOT trigger the WASI fallback. The check should explicitly compare against the string "true", e.g.:
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI === 'true')
Workaround
- Unset
NAPI_RS_FORCE_WASI entirely instead of setting it to false
Environment
- lancedb: @0.27.2
- Node.js: v24.3.0
- OS: Linux (also reproducible on other platforms)
Description
Setting
NAPI_RS_FORCE_WASI=falseas an environment variable causes lancedb to attempt loading the non-existentlancedb.wasi.cjsfile, resulting in initialization failure.Error
Root Cause
In
native.jsaround line 607:The string
"false"is truthy in JavaScript, soNAPI_RS_FORCE_WASI=falseinadvertently triggers the WASI loading path.Expected Behavior
NAPI_RS_FORCE_WASI=falseshould NOT trigger the WASI fallback. The check should explicitly compare against the string"true", e.g.:Workaround
NAPI_RS_FORCE_WASIentirely instead of setting it tofalseEnvironment