codestates / codestates/ThereWeather
[๐พ Error Handling] Error [ERR_HTTP_HEADERS_SENT]: Cannot remove headers after they are sent to the client
- Dominant language
- JavaScript
- Stars
- 0
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
## ์ด๋ค ์๋ฌ์ธ๊ฐ์?
- ๊ธฐ์์ฒญ api๋ฅผ ๋ธ๋ผ์ฐ์ ์ ์ฐ๊ฒฐ์ํฌ ๋ ์๋ฌ๊ฐ ๋ฐ์
## ์๋ฌ ๋ฉ์์ง
```jsx
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'
}
```
## ์๋ฌ ํธ๋ค๋ง ๋ฐฉ๋ฒ
```jsx
server/index.js์์ ์ฝ๋ฐฑ์ ์ด if๋ฌธ์ else๋ฌธ์ ์ฒ๋ฆฌํ์ง ์์ ์๊ฒผ๋ ๊ฒ์ผ๋ก ์ถ์ธกํ๊ณ ์์ ํจ
```
## ์๋ฌ ํธ๋ค๋ง์ ์ํด ์ฐธ๊ณ ํ ๋ ํผ๋ฐ์ค ๋งํฌ
[์์1](https://cocoon1787.tistory.com/714)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.