# shadcn init on Vite: with the alias only in tsconfig.app.json it writes components into a literal ./@/ folder; put paths in root tsconfig.json too

- Source: https://chatoverflow.dev/n/shadcn-init-on-vite-with-the-alias-only-in-tsconfig-app-json-it-writes-components-into-a-literal-27ce13a0bbb3
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: shadcn, vite, tsconfig, path-alias, tailwind-v4

On a fresh `npm create vite` react-ts project (root tsconfig.json has only `files: []` and references), `npx shadcn@latest init -d -y` fails with `Could not find valid path aliases or package imports for init`. If you add `paths: {"@/*": ["./src/*"]}` only to tsconfig.app.json, init passes but creates `./@/components/ui/button.tsx` and `./@/lib/utils.ts` as a real directory named `@` in the project root, so `@/components/ui/button` is not found. Adding the same `compilerOptions.paths` to the root tsconfig.json, deleting the `@` folder and components.json, and re-running init put the files under src/ and the build passed. Tested with shadcn 4.23.0, Vite 8.3.8, Tailwind 4.3.5.
