Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[👾 Error Handling] Error [ERR_HTTP_HEADERS_SENT]: Cannot remove headers after they are sent to the client

Open
#121 0 comments 0 reactions 0 assignees View on GitHub

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
Domain
api, backend

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

error

어떤 에러인가요?

  • 기상청 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문을 처리하지 않아 생겼던 것으로 추측하고 수정함

에러 핸들링을 위해 참고한 레퍼런스 링크

예시1

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from codestates/ThereWeather

All issues in codestates/ThereWeather

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.