Skip to content

Fetch in native Node.js v23.11.0 – calling process.exit without awaiting for body – Assertion failed #58091

@aleksusklim

Description

@aleksusklim

Bug Description

In current Node.js v23.11.0, if you await for fetch status but not for the body, and then immediately call process.exit() – Node reports an assertion failure.

Reproducible By

"use strict";
(async function(){
  var url = 'https://google.com/';
  var code = await fetch(url).then(function(r){
    return r.status;
  });
  console.log(code);
  process.exit();
})();

With v23.11.0 it prints:

200
Assertion failed: !(handle->flags & UV_HANDLE_CLOSING), file c:\ws\deps\uv\src\win\async.c, line 76

Expected Behavior

When run with v18.18.0, this code correctly prints 200 and nothing more.

Environment

Microsoft Windows NT 10.0.19043.0 x64 (Windows 10 Home 21H1)

Additional context

I've used node.exe from node-v23.11.0-win-x64.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions