Skip to content

[global] 개발 환경 CSP eval 차단 문제 수정 - #98

Merged
g-hyxn merged 2 commits into
developfrom
fix/origin-supplier-display
Jul 8, 2026
Merged

g-hyxn merged 2 commits into
developfrom
fix/origin-supplier-display

Conversation

@g-hyxn

@g-hyxn g-hyxn commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

💡 PR 요약

  • 개발 환경에서 Content-Security-Policy가 eval()을 차단해 발생하던 콘솔 에러를 수정하였습니다.
  • 백엔드가 Ingredient에 origin·supplier 필드를 지원하게 되어 더 이상 유효하지 않은 주석을 정리하였습니다.

📋 작업 내용

  • next.config.ts: NODE_ENV가 개발 환경일 때만 script-src에 'unsafe-eval'을 추가하도록 수정하였습니다. Next.js 개발 모드(Turbopack)의 HMR·콜스택 복원 기능이 eval()을 사용하는데, 기존 CSP가 운영·개발 구분 없이 항상 적용되어 콘솔에 eval() is not supported in this environment 에러가 발생하고 있었습니다. 운영 환경 CSP는 기존과 동일하게 유지됩니다.
  • src/entities/ingredient/model/types.ts: origin/supplier 필드에 달려 있던 "백엔드가 아직 제공하지 않는 필드" 주석을 제거하였습니다. Hololog-Server의 CreateIngredientRequest/UpdateIngredientRequest/IngredientResponse 등에 두 필드가 실제로 추가된 것을 /v3/api-docs 스펙으로 확인하였습니다(Hololog-Server#91, PR [auth] 영양사 회원가입 승인 절차 제거 #92 반영 완료). 프론트 코드는 두 필드를 이미 옵셔널로 다루고 있어 별도 로직 변경은 필요하지 않았습니다.

🤝 리뷰 시 참고사항

  • 기존에 등록된 재고 항목은 스키마 반영 이전에 저장된 데이터라 origin/supplier 값이 비어 있습니다. 화면에서 개별 수정(PATCH)해야 값이 채워집니다 — 백필은 별도로 진행하지 않았습니다.
  • 개발 서버를 재시작한 뒤 Content-Security-Policy 응답 헤더에 'unsafe-eval'이 포함되고 콘솔의 eval() 에러가 사라지는 것을 확인하였습니다.

@g-hyxn g-hyxn added the bug Something isn't working label Jul 8, 2026
@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hororog Ready Ready Preview, Comment Jul 8, 2026 2:04am

@g-hyxn g-hyxn self-assigned this Jul 8, 2026
@g-hyxn
g-hyxn merged commit 992076f into develop Jul 8, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
Preview — 8322659f Deployed Jul 8, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant