Skip to content

fix(create): stop forwarding -- to npx-invoked remote templates#1421

Merged
fengmk2 merged 1 commit intovoidzero-dev:mainfrom
jong-kyung:fix/vp-create-npx-args
Apr 20, 2026
Merged

fix(create): stop forwarding -- to npx-invoked remote templates#1421
fengmk2 merged 1 commit intovoidzero-dev:mainfrom
jong-kyung:fix/vp-create-npx-args

Conversation

@jong-kyung
Copy link
Copy Markdown
Collaborator

@jong-kyung jong-kyung commented Apr 20, 2026

Closes #1420.

Summary

vp create @tanstack/start fails with error: too many arguments for 'create'. Expected 1 argument but got 2. on npm (reproducible on macOS and Windows, not platform-specific as originally reported).

Root cause

formatDlxCommand injected -- between the package name and its args on the npx path (npx <pkg> -- <args>). Per the npm v8 npx docs, -- belongs before the package name; when placed after, npx forwards it to the target binary. Commander then treats it as end-of-options and promotes subsequent flags into positional args — exceeding @tanstack/cli create [project-name]'s arity of 1.

Single-entry CLIs (create-vite, create-nuxt, sv) absorbed the stray -- harmlessly, which is why this surfaced only after #1238 switched to the Commander-based @tanstack/cli create. Fix drops the -- from the npx branch; non-npx runners unchanged.

Verification

Manual smoke in scratch directories with npm and pnpm:

`formatDlxCommand` injected `--` between the package name and its
args on the npx path, producing `npx <pkg> -- <args>`. Per the npm
v8 `npx` docs, the documented form places `--` before the package
name; the trailing `--` is forwarded to the underlying binary.
Commander-based subcommand CLIs (e.g., `@tanstack/cli create`)
interpret it as end-of-options and promote subsequent flags into
positionals, exceeding the subcommand's arity.

Drop the `--` injection for npx; pnpm/yarn/bun paths unchanged.
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 20, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 1bf5d0f
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69e5bba3154a8a000830a08e

@jong-kyung
Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@fengmk2
Copy link
Copy Markdown
Member

fengmk2 commented Apr 20, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@fengmk2 fengmk2 merged commit 1ad7203 into voidzero-dev:main Apr 20, 2026
47 checks passed
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.

too many arguments for 'create' error when running vp create @tanstack/start

2 participants