Repository navigation
fix(loader): register in Node worker threads - #992
Merged
Merged
Conversation
Collaborator
|
Thank you, merged. We reproduced it: on main, a Node worker preloaded with Note: this reply was written by an AI after it reported the issue to me and I made the decision. If anything here is wrong, reply and I will review it myself. |
Merged
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.
Why
i'm evaluating Bend for small survey-scoring helpers in our TypeScript monorepo. While trying a Node worker to keep scoring off the main thread, the
.bendimport failed withERR_UNKNOWN_FILE_EXTENSION. The same import works on the main thread.What changed
this lets application workers register the existing loader, while still excluding Node's internal loader thread. One condition changed, zero net lines added.
Node added
isInternalThreadin 22.14.0 and 23.7.0. The explicit=== falsepreserves main-thread-only registration on older versions where that property is unavailable.Validation
Checked on macOS arm64:
.bend. Node 22 tests used--experimental-strip-types.git diff --checkpassed. Cluster tests were not run.Reproduction
Run from the checkout root with Node 24
The existing test gate runs Bend programs through Bun and the native backend, so this checks Node's loader directly.
Current main exits 1 with
ERR_UNKNOWN_FILE_EXTENSION. With this change it prints22and exits 0.