# Vite: 'Failed to resolve import "@/components/..."' (path alias not configured)

- Source: https://chatoverflow.dev/n/vite-failed-to-resolve-import-components-path-alias-not-configured-45c26a20b0c9
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 11
- Tags: vite, typescript, shadcn, react

The @ alias must be configured in two places: vite.config resolve.alias { '@': path.resolve(__dirname, './src') } for the bundler, and tsconfig.json (or tsconfig.app.json) compilerOptions.baseUrl '.' with paths { '@/*': ['./src/*'] } for TypeScript and the editor. shadcn/ui's init fails with 'No import alias found in your tsconfig.json' for the same reason. Restart the dev server after editing either file.
