Skip to content

fix(core): do not throw error if worker.stdout is not instanceof socket - #34224

Merged
AgentEnder merged 2 commits into
nrwl:masterfrom
drewteachout:chore/improved-deno-support
Jan 29, 2026
Merged

AgentEnder merged 2 commits into
nrwl:masterfrom
drewteachout:chore/improved-deno-support

Conversation

@drewteachout

@drewteachout drewteachout commented Jan 27, 2026 •

Copy link
Copy Markdown
Contributor

deno worker.stdout is a Readable/Writeable. To provide better deno support an error should not be thrown

Current Behavior

If worker.stdout or worker.stderr are not instanceof Socket then nx throws an error. This is problematic in Deno where stdout and stderr are Readable/Writable and not Socket.

Expected Behavior

startupPluginWorker function should work in Deno runtime

Related Issue(s)

@drewteachout
drewteachout requested a review from a team as a code owner January 27, 2026 04:19
@netlify

netlify Bot commented Jan 27, 2026 •

Copy link
Copy Markdown

👷 Deploy request for nx-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 24d8517

@vercel

vercel Bot commented Jan 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
nx-dev Ready Ready Preview Jan 28, 2026 0:28am

Request Review

@AgentEnder

Copy link
Copy Markdown
Member

Hello 👋 - this is a bug in both Bun and Deno it turns out. I've created reproductions and issue reports for them. I'll update this PR to dodge the check where necessary, but there could still be a few dragons as neither are officially supported runtimes.

Bun and Deno are typically treated in the same way .NET CLI is treated for Nx. Nx itself runs in node, but if you have tasks that should be ran with bun or deno just configure them to do so at the task level. bun goes a bit further as its an officially supported package manager, but still not for runtime.

This isnt to say it won't work, or that it shouldn't work, but generally the stance is that if something's breaking when using them to run nx itself, that points to a bug in bun or deno, not Nx.

@AgentEnder AgentEnder changed the title feat(node): do not throw error if worker.stdout is not instanceof socket fix(core): do not throw error if worker.stdout is not instanceof socket Jan 27, 2026
@nx-cloud

nx-cloud Bot commented Jan 27, 2026 •

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 24d8517

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ✅ Succeeded 45m 45s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 2m 50s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 11s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-29 07:48:57 UTC

nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

@drewteachout

Copy link
Copy Markdown
Contributor Author

Hey 👋, thanks for the response.

Makes perfect sense to me that nx doesn't officially support deno or bun. Thanks for making those issues.

I like what you did checking the runtime and warning instead of strictly erroring.

Am new here, what does it take to get this merged and released? Other than fix the 3 failing checks

@AgentEnder

Copy link
Copy Markdown
Member

I'll get it the rest of the way over the line, thanks for kicking it off :)

drewteachout and others added 2 commits January 27, 2026 19:13
deno worker.stdout is a Readable/Writeable. To provide better deno support an error should not be
thrown
…port

Add a new utility function to handle piping and unreffing child process streams with cross-runtime compatibility.

The function:
- Pipes the source to destination
- Attempts to unref the source stream
- Uses duck-typing to check for unref support
- Provides helpful warnings for alternative runtimes (Bun/Deno)

@nx-cloud nx-cloud Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nx Cloud has identified a flaky task in your failed CI:

Since the failure was identified as flaky, the solution is to rerun CI. Because this branch comes from a fork, it is not possible for us to push directly, but you can rerun by pushing an empty commit:

git commit --allow-empty -m "chore: trigger rerun"
git push

Nx Cloud View detailed reasoning in Nx Cloud ↗


🎓 Learn more about Self-Healing CI on nx.dev

@AgentEnder
AgentEnder merged commit e189dcc into nrwl:master Jan 29, 2026
13 of 16 checks passed
FrozenPandaz pushed a commit that referenced this pull request Jan 29, 2026
…et (#34224)

deno worker.stdout is a Readable/Writeable. To provide better deno
support an error should not be thrown

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
If `worker.stdout` or `worker.stderr` are not instanceof Socket then nx
throws an error. This is problematic in Deno where `stdout` and `stderr`
are Readable/Writable and not Socket.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`startupPluginWorker` function should work in Deno runtime

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

- denoland/deno#31961
- oven-sh/bun#26505

---------

Co-authored-by: Craigory Coppola <craigorycoppola@gmail.com>
(cherry picked from commit e189dcc)
@github-actions

github-actions Bot commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 4, 2026

This branch was successfully deployed

1 active deployment
Preview — 24d85173 Deployed Jan 28, 2026 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants