A circular dependency occurs when modules directly or indirectly import one another. ES modules support these cycles, but initialization order can expose incomplete or undefined imported values. section 3.4
Initialization hazard
Module A imports Module B, while Module B imports Module A. The engine initializes each module up to its export statements before resolving imports; if either module reads an imported value before its dependency finishes initializing, that value may be incomplete or undefined. section 3.4
Interview-ready points:
- Treat circular dependencies as a maintainability risk and avoid them whenever possible. section 3.4
- Relate the issue to ES module initialization rather than assuming imports are immediately usable. section 3.4






