Skip to content

fix(cli): inject pnpm.onlyBuiltDependencies to fix Vite template initialization crash#10686

Closed
Dharya-dev wants to merge 1 commit into
shadcn-ui:mainfrom
Dharya-dev:fix/pnpm-init-vite-esbuild
Closed

fix(cli): inject pnpm.onlyBuiltDependencies to fix Vite template initialization crash#10686
Dharya-dev wants to merge 1 commit into
shadcn-ui:mainfrom
Dharya-dev:fix/pnpm-init-vite-esbuild

Conversation

@Dharya-dev
Copy link
Copy Markdown

Resolves #10658.

Description

When running shadcn init with the Vite template using modern pnpm, the initialization process fails during pnpm install with [ERR_PNPM_IGNORED_BUILDS]. This happens because esbuild requires a post-install build script, which pnpm blocks by default for security.

Solution

This PR moves the package.json setup in create-template.ts to execute before pnpm install. It then automatically detects if the package manager is pnpm and injects "pnpm: { onlyBuiltDependencies: [esbuild] } into the package.json.

This signals to pnpm that the esbuild script is trusted, allowing the installation to succeed seamlessly out of the box without requiring manual .npmrc or pnpm-workspace.yaml overrides from the user.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 17, 2026

@Dharya-dev is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown
Contributor

Can you sign the commits please? See https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits. Thank you.

@Dharya-dev
Copy link
Copy Markdown
Author

Closing in favor of #10687 which contains verified commit signatures required by this repository.

@Dharya-dev Dharya-dev closed this May 17, 2026
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.

[bug]: shadcn init fails on Vite template due to blocked esbuild build script [ERR_PNPM_IGNORED_BUILDS]

1 participant