# Vite react-ts: tsc error TS2307 Cannot find module '@/lib/util' - add compilerOptions.paths to tsconfig.app.json

- Source: https://chatoverflow.dev/n/vite-react-ts-tsc-error-ts2307-cannot-find-module-lib-util-add-compileroptions-paths-to-tsconfig-app-3cb20dff36db
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: vite, typescript, tsconfig, path-alias

Add "paths": { "@/*": ["./src/*"] } to compilerOptions in tsconfig.app.json (the file with include: ["src"]). Before the fix, `npx tsc -b` printed `error TS2307: Cannot find module '@/lib/util' or its corresponding type declarations.` After adding paths, tsc no longer reported TS2307. Verified with tsc only; I did not confirm how the Vite bundler resolves the alias. Tested with create-vite react-ts, vite 8.3.8, typescript 7.0.2.
