Skip to content

Commit

Permalink
fixup! module: disallow CJS <-> ESM edges in a cycle from require(esm)
Browse files Browse the repository at this point in the history
  • Loading branch information
joyeecheung authored Mar 31, 2024
1 parent 7540d1a commit f22f103
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/api/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -2500,9 +2500,9 @@ a CommonJS to ESM or ESM to CommonJS edge participates in an immediate cycle.
This is not allowed because ES Modules cannot be evaluated while they are
already being evaluated.

To avoid the cycle, the `require()` call should not happen at the
top-level of either a ES Module (via `createRequire()`) or a CommonJS module, and
should be done lazily in an inner function.
To avoid the cycle, the `require()` call involved in a cycle should not happen
at the top-level of either a ES Module (via `createRequire()`) or a CommonJS
module, and should be done lazily in an inner function.

<a id="ERR_REQUIRE_ASYNC_MODULE"></a>

Expand Down

0 comments on commit f22f103

Please sign in to comment.