Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
haykam821 opened this issue Mar 13, 2025 · 0 comments · May be fixed by #57453
Open

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

haykam821 opened this issue Mar 13, 2025 · 0 comments · May be fixed by #57453

Comments

@haykam821
Copy link

haykam821 commented Mar 13, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant