Menu

1 / 2

5 Cycles Invisible in 14,556 Files. The Cache Bug That Hid Them.

DEV Community: node·Ofri Peretz·5 months ago
#qDzyBW9E
#dev#import#cycle#cycles#cache
Reading 0:00
15s threshold

Run no-cycle on your full monorepo, then run it again on a known-complex subdirectory. If the subset finds more cycles than the full run — you have the same class of bug we had.

We found 5 import-graph cycles in 33 files that were invisible in 14,556 — next.js, 131K stars. The cause: a 10-hop depth limit that wrote false "non-cyclic" entries into a shared cache, poisoning later traversals. Large scope → more files processed before the subset → more false cache entries → more cycles hidden. Small scope → clean cache → same cycles visible.

The cache bug is confirmed in source; the fix is in [email protected] . The detected cycles are mixed-edge: one direction is a value import, the other is import type .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.