Skip to content

Node.js 27 regression: repl implicitly awaits Promise objects #67619

Open

Description

@nicolo-ribaudo

Version

v27.0.0-alpha.0.1.1

Platform


Subsystem

repl

What steps will reproduce the bug?

In the node repl:

> await 2
2
> Promise.resolve(2)
2
> await 1; Promise.resolve(2);
2
> new Promise(() => {})

How often does it reproduce? Is there a required condition?

always

What is the expected behavior? Why is that the expected behavior?

Those four lines should log respectively 2, Promise { 2 }, Promise { 2 }, and Promise { <pending> }, since it's what their contents complete to (potentially asynchronously).

That is how it works in Node.js 26, and how it works in Chrome devtools (and how it should work in Firefox devtools, see https://bugzilla.mozilla.org/show_bug.cgi?id=1918327).

What do you see instead?

Whenever a line completes with a promise, Node.js 27 implicitly awaits it. It always prints the contents of the promise rather than the promise itself, and for cases like new Promise(() => {}) it just hangs forever.

Additional information

This bug was also reported years ago (#43777) and it was fixed in Node.js 19 (#43827), but now it's back.

I believe it's caused by #64034. That PR deleted the tests introduced by #43827 (in parallel/test-repl-top-level-await.js), claiming "No need to test TLA — it's supported natively by the inspector".

Activity

  1. added
    replIssues and PRs related to the REPL subsystem.
    v27.xIssues that can be reproduced on v27.x or PRs targeting the v27.x-staging branch.
    on Nov 19, 2026
  2. aduh95 commented on Nov 22, 2026

    @aduh95
    Contributor

    /cc @nodejs/repl

  3. avivkeller commented on Nov 23, 2026

    @avivkeller
    Member

    Yeah, this is definitely a result of natively supporting TLA

  4. self-assigned this
    on Nov 23, 2026
  5. avivkeller commented on Nov 23, 2026

    @avivkeller
    Member

    We probably double await the promise in our REPL to try and workaround a V8 bug that was fixed before that PR landed

  6. avivkeller commented on Nov 23, 2026

    @avivkeller
    Member

    Opened #67721!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

replIssues and PRs related to the REPL subsystem.v27.xIssues that can be reproduced on v27.x or PRs targeting the v27.x-staging branch.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions