-
-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New --import
API breaks worker threads
#354
Comments
I tried passing options to the I think this is really a Node bug or design issue. If a loader was specified at the top level, Node should be using that automatically for Worker threads. |
Other notes
|
This comment has been minimized.
This comment has been minimized.
I've found a temporary workaround: while developing, you'll want your worker to load const tsx = new URL(import.meta.resolve('tsx/cli'));
const worker = new Worker(tsx, {env: SHARE_ENV, argv: ['./your/script.ts']}); |
Looked into this. Sounds like this is a limitation on Node's end? Marking this as blocked |
This is an issue for node v18.19.0 too |
This comment was marked as off-topic.
This comment was marked as off-topic.
🛑 Want this fixed?This is currently a limitation in Node.js. The issue was closed without resolution: nodejs/node#47747 They currently don't think the performance cost is worth it, but are open to learning about more use-cases. I have requested for it to be re-opened. If you'd like loaders to be supported in Workers, your best course of action is to share your use-case there. Again, don't just say "plz fix". Share your use-case in nodejs/node#47747. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This is blocked by Node.js. Please contribute constructively in nodejs/node#47747 Looks like it's been re-opened with a potential solution that could use help. Locking thread until resolved in Node. |
Work around Ava / Node.js incompatibility. See privatenumber/tsx#354
nodejs/node#47747 was closed without fix |
I'm going to lock this issue again to avoid unproductive comments and encourage actionable steps. Since the root problem lies within Node, the conversation will have to happen there. If the Node issue was closed without a resolution, I suggest filing a new one with a clear, reproducible example to demonstrate how the problem still exists. |
Problem
I was tracking #330 closely and was very happy for you to fix it with #337 and release so quickly, but I just now tested it with loading worker threads and that fails with
ERR_UNKNOWN_FILE_EXTENSION
.Minimal example:
Result:
Expected behavior
If I run the minimal example with tsx
v3.13.0
the output is as expected (though with warnings):Minimal reproduction URL
Included in issue
Version
v3.14.0
Node.js version
v20.8.0
Package manager
yarn
Operating system
Linux
Contributions
The text was updated successfully, but these errors were encountered: