Menu

Post image 1
Post image 2
1 / 2
0

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

DEV Community: node·Ofri Peretz·3 days ago
#qDzyBW9E
#dev#import#cycle#cycles#cache#next
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 eslint-plugin-import-next@2.3.6 . The detected cycles are mixed-edge: one direction is a value import, the other is import type . eslint-plugin-import/no-cycle v2.32.0 skips import type edges by design ( importer.importKind === 'type' check, line 93 of no-cycle.js), which is why its count differs from ours — different edge-counting policies, not a bug in either tool.…

Continue reading — create a free account

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

Read More