Disable native addon loading on native edge binaries (WASIX parity) - #113
Closed
Arshia001 wants to merge 1 commit into
Closed
Disable native addon loading on native edge binaries (WASIX parity)#113Arshia001 wants to merge 1 commit into
Arshia001 wants to merge 1 commit into
Conversation
Native and WASIX must expose the exact same functionality, and WASIX has no dynamic linking — so process.dlopen now throws a catchable ERR_DLOPEN_FAILED before ever calling dlopen(), on every target. Failing early is load-bearing: legacy NAPI_MODULE-style prebuilds (bufferutil, utf-8-validate, most node-gyp-build prebuilds) call the unexported napi_module_register symbol from a static constructor *during* dlopen, which previously killed the whole process with an uncatchable dynamic linker error. With the early throw, optional native accelerators fall back to their pure-JS implementations exactly as they do under WASIX. The now-unreachable dlopen machinery (library cache, initializer lookup, open/close helpers) is removed. N-API support itself is unaffected: native napi tests are statically linked, and safe mode / WASIX load addons through the wasmer napi extension. Verified: process.dlopen throws catchably on both the QuickJS and V8 native binaries; bufferutil resolves to its JS fallback; js-hedgedoc passes Node/native/WASIX and js-totaljs-cms native unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Member
Author
|
Since the aim is to eventually enable dynamic module loading on WASIX as well, this change doesn't make a lot of sense. |
Arshia001
added a commit
that referenced
this pull request
Jul 20, 2026
PRs #113 (disable native addon loading) and #114 (process.platform='linux' under WASIX) were closed without merging, so this branch no longer carries them. Two apps depended on that behavior, each on one stage only: * js-hedgedoc on native — its optional ws accelerators bufferutil and utf-8-validate ship legacy NAPI_MODULE prebuilds that call the unexported napi_module_register from a static constructor during dlopen, killing the process (exit 127) before any JS runs. #113's early catchable throw is what made this fall back to the pure-JS path. Passes on WASIX (no dlopen). * js-uptime-kuma on WASIX — playwright-core's registry throws `Unsupported platform: wasi` at require time. Passes on native. js-remix-staticsite is unskipped again on WASIX: it was only skipped because #114 made `arch` take its execSync path, and it passes now (verified 1/1). Verified locally: native 17 pass / WASIX 16 pass, with the pre-existing local js-etherpad environment failure (pnpm-in-app + oidc-provider ttl; green in CI) the only remainder. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split out of #111.
Native and WASIX edge binaries must expose the same functionality. WASIX cannot load native addons, so the native binaries now refuse them too:
process.dlopenthrows a catchableERR_DLOPEN_FAILEDbefore any real dlopen happens. The early catchable throw is load-bearing — packages with optional native accelerators (bcrypt, sqlite3, etc.) hit their JS fallback path identically on both targets.🤖 Generated with Claude Code