Skip to content

fix(update): Do not hang if package manager is not present#243

Merged
dmoerner merged 1 commit intomainfrom
daniel/fix-clerk-update-yarn-hang
Apr 28, 2026
Merged

fix(update): Do not hang if package manager is not present#243
dmoerner merged 1 commit intomainfrom
daniel/fix-clerk-update-yarn-hang

Conversation

@dmoerner
Copy link
Copy Markdown
Contributor

I don't have yarn installed, and this produced a hang on clerk update. The cause of the hang was that it was sitting waiting for user confirmation to download yarn, but never surfaced this to the user. Instead, ignore stdin, explicitly do not use corepack download prompts, and add a timeout.

I don't have `yarn` installed, and this produced a hang on `clerk
update`. The cause of the hang was that it was sitting waiting for user
confirmation to download `yarn`, but never surfaced this to the user.
Instead, ignore `stdin`, explicitly do not use corepack download
prompts, and add a timeout.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 28, 2026

🦋 Changeset detected

Latest commit: 8ce4615

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
clerk Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dmoerner
Copy link
Copy Markdown
Contributor Author

!snapshot

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 39c71e9a-71c0-46c8-ba50-680ce8f6bd27

📥 Commits

Reviewing files that changed from the base of the PR and between 30d9724 and 8ce4615.

📒 Files selected for processing (2)
  • .changeset/clerk-update-yarn-hang.md
  • packages/cli-core/src/lib/installer.ts

📝 Walkthrough

Walkthrough

A new Changesets metadata file documents a clerk patch update addressing package manager probe hangs. The installer.ts file is refactored to consolidate npm/pnpm/yarn global directory discovery into a shared probePmDir routine that detaches stdin, disables corepack download prompts via environment variable, enforces a 1500ms timeout, and provides unified error handling that returns null on spawn errors, nonzero exits, timeouts, or empty output. This replaces the prior implementation using Bun's $(...).quiet().nothrow() with individual exitCode checks per package manager.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: fixing an issue where clerk update would hang if a package manager is not present, which is directly addressed by the implementation.
Description check ✅ Passed The description clearly explains the problem (hang when yarn not installed due to hidden corepack prompt) and the solution (ignore stdin, disable corepack prompts, add timeout), which aligns with the changeset and implementation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

Snapshot published

npm install -g clerk@1.1.1-snapshot.8ce4615
Package Version
clerk 1.1.1-snapshot.8ce4615

Published from 8ce4615

@dmoerner dmoerner requested a review from rafa-thayto April 28, 2026 20:00
@dmoerner dmoerner merged commit 17606be into main Apr 28, 2026
7 checks passed
@dmoerner dmoerner deleted the daniel/fix-clerk-update-yarn-hang branch April 28, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants