You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Async output in repl is showing after the prompt #35895
changed the title [-]Rejected promise prevents repl from showing prompt if somithing is logged before[/-][+]Async output in repl is showing after the prompt[/+]on Oct 31, 2020
Ok i'm testing the scenario from master now. The scenario mentioned:
> new Promise((rs, rj) => { rj(); })
Promise { <rejected> undefined }
> (node:4108) UnhandledPromiseRejectionWarning: undefined
(node:4108) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 7)
// no NEW prompt
The reason the Uncaught part now works is that it does not cause a deprecation warning anymore due to the specified unhandled rejection warning.
It is tricky to fix this, since we write on the stream directly. We do not use the regular input methods for e.g., warnings. And what should happen for async writes on the stream? Should they be marked specially? It is currently intermixed with the line input and visualized as input. That's incorrect but difficult to fix, especially in a way that is easy to understand for users.
This issue has been stale for a long time. Also, it focuses on an old, no longer supported version of Node. I'll close it for those reasons. If needed, feel free to reopen.
Activity
[-]Rejected promise prevents repl from showing prompt if somithing is logged before[/-][+]Async output in repl is showing after the prompt[/+]antsmartian commentedon Mar 17, 2021
Ok i'm testing the scenario from master now. The scenario mentioned:
is now crashing the repl altogether.
vsemozhetbyt commentedon Mar 17, 2021
When I try it in 15.11.0 or in today's nightly or canary, I get the same output, now it seems OK:
antsmartian commentedon Mar 18, 2021
@vsemozhetbyt Yes the other issues still seems to be present.
BridgeAR commentedon Apr 10, 2021
The reason the Uncaught part now works is that it does not cause a deprecation warning anymore due to the specified unhandled rejection warning.
It is tricky to fix this, since we write on the stream directly. We do not use the regular input methods for e.g., warnings. And what should happen for async writes on the stream? Should they be marked specially? It is currently intermixed with the line input and visualized as input. That's incorrect but difficult to fix, especially in a way that is easy to understand for users.
StefanStojanovic commentedon Oct 8, 2024
This issue has been stale for a long time. Also, it focuses on an old, no longer supported version of Node. I'll close it for those reasons. If needed, feel free to reopen.