Skip to content

Bad formatting in require(esm) module cycle error message #57451

@haykam821

Description

@haykam821

Version

v23.9.0

Subsystem

module

What steps will reproduce the bug?

In index.cjs:

const library = require("./library.mjs");

In library.mjs:

import "./index.cjs";

By executing node ./library.mjs, the incorrect error message will appear.

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

This error message appears with the same grammar and formatting every time the error appears.

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

The expected behavior would be to have an error message without formatting issues and confusing word choices. In particular, I was unsure about the word 'madated' and whether that was runtime-specific lingo I wasn't aware of.

What do you see instead?

Error [ERR_REQUIRE_CYCLE_MODULE]: Cannot require() ES Module [-snip-] in a cycle. (from [-snip-]s)A cycle involving require(esm) is disallowed to maintain invariants madated by the ECMAScript specificationTry making at least part of the dependency in the graph lazily loaded.

Additional information

I am willing to open a pull request to resolve this issue.

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