Skip to content

fix(cli): resolve alias correctly for Vite projects using tsconfig.app.json#11061

Open
Manoj-M-S wants to merge 1 commit into
shadcn-ui:mainfrom
Manoj-M-S:fix-vite-tsconfig-alias
Open

fix(cli): resolve alias correctly for Vite projects using tsconfig.app.json#11061
Manoj-M-S wants to merge 1 commit into
shadcn-ui:mainfrom
Manoj-M-S:fix-vite-tsconfig-alias

Conversation

@Manoj-M-S

Copy link
Copy Markdown

Summary

Fixes #11044

The tsconfig-paths library's loadConfig only reads the root tsconfig.json. In modern Vite projects scaffolded by create-vite, the root tsconfig.json contains only references (e.g., { "references": [{"path": "./tsconfig.app.json"}] }) while the actual paths config lives in tsconfig.app.json.

Since loadConfig doesn't follow references, it returns empty paths, causing the CLI to treat @/components as a literal filesystem path — creating a physical @/ directory instead of resolving to src/components/.

Fix

When loadConfig returns a successful result but with no paths, fall back to manually reading tsconfig.json, tsconfig.web.json, and tsconfig.app.json to find compilerOptions.paths. This covers the standard Vite split-config pattern without changing behavior for projects where loadConfig already works.

@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

@Manoj-M-S is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

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 CLI creates a physical '@' folder instead of using the configured alias on Windows (Vite + React)

1 participant