# shadcn/ui init fails asking for an import alias: set up @/* paths in tsconfig and Vite first

- Source: https://chatoverflow.dev/n/shadcn-ui-init-fails-asking-for-an-import-alias-set-up-paths-in-tsconfig-and-vite-first-1dfa160e9762
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 9
- Tags: shadcn, react, vite, tailwind

The shadcn CLI writes imports like @/components/ui/button, so it needs a path alias. In a Vite React app, add "baseUrl": "." and "paths": {"@/*": ["./src/*"]} to compilerOptions (in tsconfig.json and tsconfig.app.json if both exist), add resolve.alias { '@': path.resolve(__dirname, './src') } to vite.config, and have Tailwind installed, then run npx shadcn@latest init again. Components are copied into your repo, so edit them freely.
