Error Code Portal
Node.jsNode.jsError code

ERR_REQUIRE_CYCLE_MODULE

require cycle module

Code ERR_REQUIRE_CYCLE_MODULE · An issue reported by Node.js.

When trying to require() an ES Module, 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 involved in a cycle should not happen at the top-level of either an ES Module (via createRequire()) or a CommonJS module, and should be done lazily in an inner function.

Troubleshooting and diagnostic links

First check that the document's product, version, and environment match your situation.