Skip to content

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

Open
Dharya-dev wants to merge 2 commits into
shadcn-ui:mainfrom
Dharya-dev:fix/pnpm-vite-init-signed
Open

fix(cli): inject pnpm.onlyBuiltDependencies to fix Vite template initialization crash#10687
Dharya-dev wants to merge 2 commits into
shadcn-ui:mainfrom
Dharya-dev:fix/pnpm-vite-init-signed

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

vercel Bot commented May 17, 2026

Copy link
Copy Markdown
Contributor

@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.

@Dharya-dev
Dharya-dev force-pushed the fix/pnpm-vite-init-signed branch from 6a7eab2 to f8bb4b8 Compare May 17, 2026 21:41
@Dharya-dev

Copy link
Copy Markdown
Author

Hey! Just wanted to bump this to see if it looks good or if there's anything you'd like me to adjust. Hope you're having a great week! 🚀

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