Next.js 13 TypeError: ???.getSetCookie is not a function 문제 해결하기
하루종일 Webstorm을 잡고 Next.js 버전 문제, 쿠키 모듈 수정 등 여러가지 시도를 해봤으나 답을 알 수 없는 상황에서 오늘 올라온 스택 오버플로우의 질문과 답변으로 해결됐다.
Author
Younggun Park
Frontend engineer and builder · Seoul, South Korea
I'm building Vision AI products at P2ACH AI, writing about frontend systems, AI tooling, and the quiet parts of shipping.
TL;DR
하루종일 Webstorm을 잡고 Next.js 버전 문제, 쿠키 모듈 수정 등 여러가지 시도를 해봤으나 답을 알 수 없는 상황에서 오늘 올라온 스택 오버플로우의 질문과 답변으로 해결됐다.
On this page
TypeScript
TypeError: responseHeaders.getSetCookie is not a function
at new ResponseCookies (webpack-internal:///(app-metadata-route)/./node_modules/next/dist/compiled/@edge-runtime/cookies/index.js:213:47)
at new NextResponse (webpack-internal:///(app-metadata-route)/./node_modules/next/dist/server/web/spec-extension/response.js:40:22)
at GET (webpack-internal:///(app-metadata-route)/./node_modules/next/dist/build/webpack/loaders/next-metadata-route-loader.js?page=%2Ffavicon.ico%2Froute&isDynamic=0!./src/app/favicon.ico?__next_metadata_route__:15:10)오늘 갑자기 코드에서 무진장 에러가 곳곳에서 떴다.
특히 서버 컴포넌트를 사용하는 쪽에서 getSetCookie 이슈가 발생했다.
하루종일 Webstorm을 잡고 Next.js 버전 문제, 쿠키 모듈 수정 등 여러가지 시도를 해봤으나 답을 알 수 없는 상황에서 오늘 올라온 스택 오버플로우의 질문과 답변으로 해결됐다.
Solution(해결방안)
I got same error with Node 18.12.1 and next ==13.5.5. And it disappeared with next ==13.5.4 or with Node 18.18.2.
Node.js 버전 문제로 보인다. 노드 버전 18.18.2에서 문제가 해결됐다.
reference
https://stackoverflow.com/questions/77304623/nextjs-typeerror
FAQ
Common follow-up questions
- 이 글의 핵심은 무엇인가요?
- 하루종일 Webstorm을 잡고 Next.js 버전 문제, 쿠키 모듈 수정 등 여러가지 시도를 해봤으나 답을 알 수 없는 상황에서 오늘 올라온 스택 오버플로우의 질문과 답변으로 해결됐다.
- 실무적으로 먼저 볼 포인트는 무엇인가요?
- I got same error with Node 18.12.1 and next ==13.5.5. And it disappeared with next ==13.5.4 or with Node 18.18.2.
Tags
Related posts
View all writingNext.js 마이그레이션으로 고생했는데, 새로운 기술은 시간과 노력을 충분히 들일 수 있을 때 시작. 급하면 익숙한것 먼저 사용한 후 다음에 바꾸는 것을 추천. 기술을 공부하고 싶으면 사용하는 것도 좋을듯.
Dec 7, 2023