Skip to content

Promisify crashing node (or making it hang) #49607

@SamMousa

Description

@SamMousa

Version

v20.6.1

Platform

Linux xxx 6.2.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Mon Aug 14 13:42:26 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

Run this code:

import {promisify } from "node:util";


const asyncFunction = async () => 5;

await promisify(asyncFunction)();
console.log('This does not show');

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

Every time

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

Anything but a silent crash... if it's not allowed throw an error, if you do accept async functions maybe promisify should be a noop since async functions already return promises...

I'm no node developer

What do you see instead?

Status code 0, process exits.

Additional information

This bug breaks packages like this: semantic-release/commit-analyzer#525

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