Skip to content

Tracking issue for node runMain bug #1846

@cspotcode

Description

@cspotcode

Node shipped a Module.runMain bug in 18.6.0 introduced by loader chaining. They've subsequently implemented a fix: nodejs/node#43763

ts-node shipped a workaround that version-detects 18.6.0. The workaround doesn't preserve require.main and it's a hack I want to remove once the next node v18 is released.

Loader chaining and this fix are being backported to node v16. So v16 should never exhibit this behavior, but good to keep an eye on it.

This issue can be closed once we're able to remove the workaround hack for v18 and we've confirmed that node 16 ships loader chaining without the bug.

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