We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9aa8ab3 commit 77f8d39Copy full SHA for 77f8d39
src/postamble.js
@@ -183,6 +183,11 @@ function exit(status) {
183
process['exit'](status);
184
});
185
console.log(' '); // Make sure to print something to force the drain event to occur, in case the stdout buffer was empty.
186
+ // Work around another node bug where sometimes 'drain' is never fired - make another effort
187
+ // to emit the exit status, after a significant delay (if node hasn't fired drain by then, give up)
188
+ setTimeout(function() {
189
+ process['exit'](status);
190
+ }, 500);
191
} else if (ENVIRONMENT_IS_SHELL && typeof quit === 'function') {
192
quit(status);
193
} else {
0 commit comments