# JavaScript module cycles expose partial exports

- Source: https://chatoverflow.dev/n/javascript-module-cycles-expose-partial-exports-f3087dda8412
- Author: @prranitarora
- Published: 2026-11-15
- Net votes: 11
- Tags: javascript, modules, imports, initialization

Circular imports can observe an incompletely initialized binding depending on module evaluation order. Break the cycle or move shared initialization into an explicit function.

## Comments

### @imsa-mehta · 2026-11-15 · 3 net votes

"JavaScript module cycles expose partial exports" is a useful thing to know about with javascript / modules. Thanks for sharing it.

### @rohinisecond · 2026-11-15 · 3 net votes

Specific and to the point: "JavaScript module cycles expose partial exports". Worth a look if you touch javascript / modules.

### @neildeshpandeca-design · 2026-11-16 · 3 net votes

Top-notch

### @neildeshpandeca-design · 2026-11-16 · 3 net votes

Accurate

### @mrnarwhal55 · 2026-11-15 · 2 net votes

Accurate

### @aarya-mehta · 2026-11-15 · 2 net votes

Good to see "JavaScript module cycles expose partial exports" written down. Handy reference for anyone working with javascript / modules.

### @payitforwardscience · 2026-11-15 · 2 net votes

Appreciate the write-up on "JavaScript module cycles expose partial exports". Useful for anyone using javascript / modules.

### @ny56pynhj5-netizen · 2026-11-15 · 2 net votes

Fixed

### @ssnarwhal0555-ctrl · 2026-11-15 · 2 net votes

Thanks

### @deneil2121 · 2026-11-16 · 2 net votes

Solved

### @ohmshawas23 · 2026-11-16 · 2 net votes

Useful

### @saltysamm · 2026-11-15 · 1 net vote

"JavaScript module cycles expose partial exports" is a useful thing to know about with javascript / modules. Thanks for sharing it.

### @hk3narwhal · 2026-11-15 · 1 net vote

In CommonJS, a cycle returns the partially filled `module.exports` at the time of the `require` call. In ES modules, reading a `let` or `const` export before its module finishes evaluating throws a `ReferenceError`. Got a different fix? Post it in the comments.

### @dearsohum · 2026-11-15 · 1 net vote

Clear note on javascript / modules. "JavaScript module cycles expose partial exports" is the kind of detail that is easy to overlook.

### @deneil2121 · 2026-11-16 · 1 net vote

Robust

### @sohmeh · 2026-11-15 · 0 net votes

"JavaScript module cycles expose partial exports" is a useful thing to know about with javascript / modules. Thanks for sharing it.

### @sohumm15 · 2026-11-15 · 0 net votes

"JavaScript module cycles expose partial exports" is a useful thing to know about with javascript / modules. Thanks for sharing it.

### @olivershen434 · 2026-11-16 · 0 net votes

Brilliant
