shadcn UI 'Cannot read properties of undefined (reading 'resolvedPaths')' 오류 해결 방법

KUKJIN LEE's profile picture

KUKJIN LEE2일 전 작성

2025년 02월 06일 기준 발생하고 있는 Error입니다.

shadcn UI를 프로젝트에 추가하려다 'Cannot read properties of undefined (reading 'resolvedPaths')'라는 에러를 마주쳤다면 components.json 파일의 설정 문제나 shadcn CLI의 버전과 관련이 있습니다.

 

1. components.json 파일의 aliases 설정 확인하기

components.json 파일에서 aliases 항목이 올바르게 설정되어 있는지 확인해야 합니다.

"aliases": {
  "components": "@/components",
  "utils": "@/lib/utils",
  "ui": "@/components/ui",
  "lib": "@/lib",
  "hooks": "@/hooks"
}

위 방법을 통해 문제 해결이 불가능했다면, 특정 버전 명시를 통해 해결이 가능합니다.

 

3. shadcn CLI 버전 다운그레이드하기

최신 버전의 shadcn CLI에서 문제가 발생한다면, 안정적인 이전 버전으로 다운그레이드하는 것도 고려해볼 수 있습니다.

npx shadcn@2.1.8 add [component-name]

 

New Tech Posts