Skip to content

[Bug]: react-heading 패키지 설치 후 Module not found 오류 발생#37

Merged
sooster910 merged 1 commit intomainfrom
sooster910/issue34
Aug 16, 2025
Merged

[Bug]: react-heading 패키지 설치 후 Module not found 오류 발생#37
sooster910 merged 1 commit intomainfrom
sooster910/issue34

Conversation

@sooster910
Copy link
Owner

Fixes #34

🐛 버그 수정

🐛 버그 설명

react-heading 패키지를 npm으로 설치한 후 import { Heading } from 'react-heading' 구문으로 import할 때 "Module not found: Error: Can't resolve 'react-heading'" 오류가 발생하여 애플리케이션 빌드가 실패하고 개발 서버가 실행되지 않는 문제를 수정했습니다.

🔍 원인 분석

  1. 패키지 이름 불일치: 사용자가 react-heading으로 설치하려고 하지만 실제 패키지 이름은 @hensley-ui/react-heading
  2. 빌드 파일 누락: dist 폴더가 없어서 빌드된 파일들이 없었음
  3. 모듈 포맷 혼재: CommonJS와 ESM이 혼재되어 일관성이 없었음
  4. 문서 오류: README.md에서 잘못된 패키지 이름과 import 구문 사용

🔧 수정 내용

  1. ESM 통일: 패키지를 ESM 전용으로 변경하여 일관성 확보
  2. 빌드 파일 재생성: 올바른 ESM 포맷으로 빌드 파일 생성
  3. 문서 업데이트: README.md에서 올바른 패키지 이름과 사용법 명시
  4. 설정 최적화: package.json exports 설정 및 vite.config.ts 수정

📁 변경된 파일들

  • packages/ui/react-heading/package.json: ESM 설정 및 exports 최적화
  • packages/ui/react-heading/vite.config.ts: ESM 전용 빌드 설정
  • packages/ui/react-heading/README.md: 올바른 패키지 이름과 import 구문 수정
  • packages/ui/react-heading/dist/: 빌드 파일 재생성 (index.mjs, index.d.ts 등)

🧪 테스트

  • JavaScript ESM import 테스트: ✅ 성공
  • TypeScript ESM import 테스트: ✅ 성공
  • 잘못된 패키지 이름 테스트: ✅ 예상대로 실패
  • 타입 정의 확인: ✅ 정상 작동
  • 빌드 파일 검증: ✅ ESM 포맷 정상 생성

🔗 관련 이슈

Fixes #34

✅ 체크리스트

  • 코드 리뷰를 요청했습니다
  • 테스트 코드를 작성했습니다 (로컬 테스트 프로젝트에서 검증)
  • 문서를 업데이트했습니다 (README.md 수정)
  • 브랜치 이름이 의미있게 지어졌습니다
  • 커밋 메시지가 명확합니다

�� 사용법 (수정 후)

# 올바른 설치 방법
npm install @hensley-ui/react-heading

# 올바른 import 방법
import { Heading } from '@hensley-ui/react-heading'

�� Breaking Changes

  • 패키지가 ESM 전용으로 변경됨 (CommonJS 지원 제거)
  • 사용자는 @hensley-ui/react-heading 패키지 이름을 사용해야 함

참고: 이 PR은 AI 자동 코드리뷰 시스템에 의해 자동으로 리뷰됩니다! 🤖

@changeset-bot
Copy link

changeset-bot bot commented Aug 16, 2025

🦋 Changeset detected

Latest commit: 58dbcd5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@hensley-ui/react-heading Patch
playground Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@sooster910 sooster910 self-assigned this Aug 16, 2025
@sooster910 sooster910 merged commit d009197 into main Aug 16, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: react-heading 패키지 설치 후 Module not found 오류 발생

1 participant