Skip to content

Conversation

@GitTuanKiet
Copy link

Error caused by #181.

Run bunx solidui-cli@latest add button, error:

ExecaError: Command failed with exit code 1: bun add '' '@kobalte/core'

Error caused by stefan-karger#181.

Run bunx solidui-cli@latest add button, error:

ExecaError: Command failed with exit code 1: bun add '' '@kobalte/core'
@changeset-bot
Copy link

changeset-bot bot commented Jan 21, 2026

⚠️ No Changeset found

Latest commit: 7c534d5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@vercel
Copy link

vercel bot commented Jan 21, 2026

@GitTuanKiet is attempting to deploy a commit to the Stefan EK's projects Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps
Copy link

greptile-apps bot commented Jan 21, 2026

Greptile Summary

Fixes the bug introduced in PR #181 where non-deno package managers (npm, yarn, pnpm, bun) received an empty string argument, causing command execution failures.

Key Changes:

  • Added .filter(Boolean) to remove the empty string from the command array when packageManager !== "deno"
  • Ensures only valid arguments are passed to package manager executables

Issues Found:

  • The same bug pattern exists in packages/cli/src/commands/init.ts at lines 100-104, which will cause the same failure during project initialization with non-deno package managers

Confidence Score: 3/5

  • This PR is safe to merge but incomplete - it fixes the bug in one location while the same bug remains in another file
  • The fix is technically correct and solves the reported issue in add.ts, but the identical bug pattern exists in init.ts and wasn't addressed. This means users will still encounter the same error during project initialization with non-deno package managers.
  • Check packages/cli/src/commands/init.ts - it has the same bug pattern that needs the same fix

Important Files Changed

Filename Overview
packages/cli/src/commands/add.ts Fixed empty string argument bug by filtering falsy values before passing to package manager command

Sequence Diagram

sequenceDiagram
    participant User
    participant CLI as add command
    participant PM as Package Manager Detection
    participant Execa as Command Executor
    
    User->>CLI: bunx solidui-cli@latest add button
    CLI->>PM: getPackageManager(cwd)
    PM-->>CLI: "bun"
    
    Note over CLI: Before fix (PR #181):<br/>["add", ...dependencies]
    Note over CLI: After PR #181 (broken):<br/>["add", "", ...dependencies]
    Note over CLI: After this fix:<br/>["add", ...dependencies]<br/>(empty string filtered)
    
    CLI->>CLI: Build command array:<br/>["add", packageManager === "deno" ? "--npm" : "", ...dependencies]
    CLI->>CLI: .filter(Boolean) removes empty string
    CLI->>Execa: execa("bun", ["add", "@kobalte/core"], {cwd})
    Execa-->>CLI: Success
    CLI-->>User: Component installed
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Additional Comments (1)

  1. packages/cli/src/commands/add.ts, line 151-155 (link)

    logic: Same bug exists in packages/cli/src/commands/init.ts:100-104 - the empty string from the ternary operator isn't filtered there. Apply the same .filter(Boolean) fix to init.ts to prevent the same error during initialization.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

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.

1 participant