Skip to content
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

return null rather than process.stdin on child process #17741

Merged
merged 1 commit into from
Feb 27, 2025

Conversation

pfgithub
Copy link
Contributor

What does this PR do?

Fixes BUN-10870, Fixes shadcn-ui/ui#6145, Fixes shadcn-ui/ui#4778, Fixes shadcn-ui/ui#5421

  • bunx --bun shadcn@latest init runs npx create-next-app with node symlinked to bun
    • npx has #!/usr/bin/env node, this would resolve to bun so npx would run with bun
    • npx immediately exits with code 1, but create-next-app spawns and completes successfully
    • npx runs if (child.stdin) { child.stdin.end() }
      • the child process was spawned with inherit, so it has no stdin
      • bun was returning process.stdin in that case, rather than null like node
      • BUN-10874 process.stdin.end is Infinity rather than a function
    • TypeError: Infinity is not a function
    • npx catches this error and exits immediately with code 1
  • shadcn init fails

@robobun
Copy link

robobun commented Feb 27, 2025

Updated 7:08 PM PT - Feb 26th, 2025

@pfgithub, your commit 1805e4c has 3 failures in Build #12363:


🧪   try this PR locally:

bunx bun-pr 17741

@pfgithub pfgithub marked this pull request as ready for review February 27, 2025 04:43
@Jarred-Sumner Jarred-Sumner merged commit 174a0f7 into main Feb 27, 2025
63 of 70 checks passed
@Jarred-Sumner Jarred-Sumner deleted the pfg/fix-shadcn-init branch February 27, 2025 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants