TrevorBurnham/dep-graph — Issue #1: Incorrect "Cyclic dependency" exception
Author: andrewschaaf
Created: 2011-11-02 11:55:16+00:00
State: open

# MAIN ---> 1 ---> 2
# \--------------\---->3
DepGraph = require 'dep-graph'
derp = new DepGraph
derp.add "MAIN", "1"
derp.add "MAIN", "3"
derp.add "1", "2"
derp.add "2", "3"
console.log derp.getChain "MAIN"

Error: Cyclic dependency from 2 to 3
at DepGraph.getChain (/node_modules/dep-graph/lib/dep-graph.js:39:17)
at DepGraph.getChain (/node_modules/dep-graph/lib/dep-graph.js:46:14)
at DepGraph.getChain (/node_modules/dep-graph/lib/dep-graph.js:46:14)
at Object. (.:9:20)
at Object. (.:10:4)
at Module._compile (module.js:402:26)
at Object.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script.js:57:25)
at /usr/local/lib/node_modules/coffee-script/lib/command.js:147:29
at Socket. (/usr/local/lib/node_modules/coffee-script/lib/command.js:181:14)
at Socket.emit (events.js:61:17)

![](http://i.qkme.me/358jzq.jpg)