3 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by staff
Error handling leaderboard command: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
[1] at ServerResponse.setHeader (node:_http_outgoing:699:11)
[1] at ServerResponse.header (C:\Users\Vader\MarvelRivalsBot\node_modules\express\lib\response.js:795:10)
[1] at ServerResponse.send (C:\Users\Vader\MarvelRivalsBot\node_modules\express\lib\response.js:175:12)
[1] at ServerResponse.json (C:\Users\Vader\MarvelRivalsBot\node_modules\express\lib\response.js:279:15)
[1] at ServerResponse.send (C:\Users\Vader\MarvelRivalsBot\node_modules\express\lib\response.js:163:21)
[1] at handleLeaderboardCommand (file:///C:/Users/Vader/MarvelRivalsBot/marvelcommands/leaderboard.js:38:20)
[1] at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
[1] code: 'ERR_HTTP_HEADERS_SENT'
[1] }
[1] node:_http_outgoing:699
[1] throw new ERR_HTTP_HEADERS_SENT('set');
[1] ^
[1]
[1] Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
[1] at ServerResponse.setHeader (node:_http_outgoing:699:11)
[1] at ServerResponse.header (C:\Users\Vader\MarvelRivalsBot\node_modules\express\lib\response.js:795:10)
[1] at ServerResponse.send (C:\Users\Vader\MarvelRivalsBot\node_modules\express\lib\response.js:175:12)
[1] at ServerResponse.json (C:\Users\Vader\MarvelRivalsBot\node_modules\express\lib\response.js:279:15)
[1] at ServerResponse.send (C:\Users\Vader\MarvelRivalsBot\node_modules\express\lib\response.js:163:21)
[1] at handleLeaderboardCommand (file:///C:/Users/Vader/MarvelRivalsBot/marvelcommands/leaderboard.js:47:20)
[1] at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
[1] code: 'ERR_HTTP_HEADERS_SENT'
[1] }
it doesn't looks as though you're using the library
discord.js
, but I imagine the issue lies earlier in your request handling
that being said, please take this elsewhere ( #other-js-ts / #useful-servers )