question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DeprecationWarning: Unhandled promise rejections are deprecated.

See original GitHub issue

Actual behaviour:

Unhandled promise rejections are deprecated.

Fix:

client.js Line 984

// Send command to server or channel..
client.prototype._sendCommand = function _sendCommand(delay, channel, command, fn) {
    // Race promise against delay..
    return new Promise((resolve, reject) => {
        _.promiseDelay(delay).then(() => { reject("No response from Twitch."); });
        // (...)
        // Disconnected from server..
        else { reject("Not connected to server."); }
    }).catch(() => {});
};

Error log:

(node:26041) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): No response from Twitch.
(node:26041) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Server configuration

  • Operating system: Debian 8.6
  • Node version (if applicable): 7.4
  • NPM version (if applicable): 4.0.5
  • tmi.js version: 1.1.2

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
zoton2commented, Jan 8, 2017

I was going to post about this ages ago but never got around to it, noticed this when I upgraded my Node version (to v6) and when I did this my bot would just randomly crash every so often, seemingly randomly. The only errors that were logged were in relation to unhandled promises, so I thought it might be those. Not sure if it was the actual issue, but it still needs fixing of course.

0reactions
erezefratcommented, Sep 22, 2017

Is this fix still coming?

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is an unhandled promise rejection? - Stack Overflow
Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a ...
Read more >
A fix to the Unhandled Promise Rejection Warning - Medium
(node:7741) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will ...
Read more >
Unhandled promise rejections are deprecated" · Issue #5311 ...
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not...
Read more >
Unhandled Promise Rejections in Node.js - The Code Barbarian
DeprecationWarning : Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.
Read more >
Node.js 15 release: Updated handling of rejections, npm 7, N ...
(rejection id: 1) (node:31727) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found