Vite + React + TypeScript failing to resolve @/components import path

19 hours ago 1
ARTICLE AD BOX

I’m working on a React + TypeScript project using Vite. When I run npm run dev, I get an import resolution error.

Error

Copy code

Failed to resolve import "@/components/layout/AppLayout"

Project details

Framework: React + TypeScript

Build tool: Vite

OS: Windows

Node version: 18+

What I tried

Checked that the file exists

Restarted dev server

Verified folder structure

Folder structure

Copy code

src/

components/

layout/ AppLayout.tsx

pages/

CheckoutPage.tsx
Read Entire Article