Skip to content

process.exit() in ESM results in exit code 13 #40808

Closed
@NMinhNguyen

Description

@NMinhNguyen

Version

v16.13.0

Platform

No response

Subsystem

No response

What steps will reproduce the bug?

echo "process.exit()" > test.mjs
node ./test.mjs # this exits with code 13
echo "process.exit()" > test.cjs
node ./test.cjs # this exits with code 0

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

Seems to only happen when using ES modules.

What is the expected behavior?

The process should exit with code 0.

What do you see instead?

The process exits with code 13.

Additional information

This seems to have been introduced in #34640 to handle unfinished TLA, but in this instance I'm not even using TLA so it seems like a false positive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    esmIssues and PRs related to the ECMAScript Modules implementation.processIssues and PRs related to the process subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions