Server Function (1) 썸네일형 리스트형 Next.js Server Function 에러 메시지가 프로덕션에서 사라지는 이유 개발 환경에서는 "이미 사용 중인 아이디입니다" 같은 에러 메시지가 잘 뜨는데,프로덕션에 배포하면 갑자기 이런 메시지로 바뀐 경험이 있을 것이다.An error occurred in the Server Components render.The specific message is omitted in production builds to avoid leaking sensitive details.원인은 Next.js의 의도적인 보안 정책이다.왜 이런 일이 생기나Next.js의 Server Function('use server')은 이름 그대로 서버에서 실행되는 함수다.클라이언트에서 호출하면 내부적으로 HTTP 요청을 만들어 서버에서 실행한다.'use server'export async function creat.. 이전 1 다음