[👾 Error Handling] Error [ERR_HTTP_HEADERS_SENT]: Cannot remove headers after they are sent to the client
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- express, javascript
Research direction
Start with server/index.js around lines 57–61 and then inspect server/controllers/get/weather.js around line 64, following the weather API request path. Reproduce the browser request and trace whether more than one response is sent. Done means the weather request completes without ERR_HTTP_HEADERS_SENT and its error path is handled consistently.
Written by the indexing model from the issue text.
Description
어떤 에러인가요?
- 기상청 api를 브라우저에 연결시킬 때 에러가 발생
에러 메시지
Error [ERR_HTTP_HEADERS_SENT]: Cannot remove headers after they are sent to the client
at new NodeError (node:internal/errors:371:5)
at ServerResponse.removeHeader (node:_http_outgoing:654:11)
at ServerResponse.send (/Users/seonhwa/Desktop/codestates31/ThereWeather/server/node_modules/express/lib/response.js:210:10)
at /Users/seonhwa/Desktop/codestates31/ThereWeather/server/index.js:61:13
at weather (/Users/seonhwa/Desktop/codestates31/ThereWeather/server/controllers/get/weather.js:64:9)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /Users/seonhwa/Desktop/codestates31/ThereWeather/server/index.js:57:5 {
code: 'ERR_HTTP_HEADERS_SENT'
}
에러 핸들링 방법
server/index.js에서 콜백에 쓴 if문에 else문을 처리하지 않아 생겼던 것으로 추측하고 수정함
에러 핸들링을 위해 참고한 레퍼런스 링크
- Dominant language
- JavaScript
- Stars
- 0
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from codestates/ThereWeather
-
error
Difficulty 1/5 Under an hour Newbie friendliness 72/100
codestates/ThereWeather#58 ·
-
devlog
Difficulty 4/5 3-5 days Newbie friendliness 20/100
codestates/ThereWeather#197 ·
-
error
Difficulty 4/5 3-5 days Newbie friendliness 25/100
codestates/ThereWeather#196 ·
-
devlog
Difficulty 5/5 Over a week Newbie friendliness 10/100
codestates/ThereWeather#195 ·
-
[👾 Error Handling] EagerLoadingError [SequelizeEagerLoadingError]: post is not associated to user!Openerror
Difficulty 3/5 1-2 days Newbie friendliness 15/100
codestates/ThereWeather#188 ·
All issues in codestates/ThereWeather
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
[quality] useFocusTrap's Shift+Tab wrap and non-Tab/non-Escape key arms are never driven end to endPossibly taken @hivecommons-hive claimed this today. Openagent/quality hive/covered-by-pr hive/hosted-available-lke648397-260827-5n31 quality testing
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
agentic-workflows
Difficulty 1/5 Under an hour Newbie friendliness 85/100
githubnext/gh-aw-workshop#4220 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
JuliusBrussee/caveman#1189 ·
Maintainers usually reply within 1 day
-
priority:low ready-for-dev
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenHands/extensions#738 ·
Maintainers usually reply within 1 day