jrburke/requirejs — Issue #202: Notifying on circular dependencies
Author: jareware
Created: 2012-03-06 11:00:29+00:00
State: open

Currently, if there is a circular dependency, the circle is broken and one or more dependencies aren't injected. This is a good default I guess, but as the docs state, a circular dependency often indicates there might be a design problem.

Would it be possible to add an optional behavior of throwing an error when a cycle is detected? In projects were they're actively being avoided, it would help debugging to immediately see an error instead of waiting for its discovery when you get a "can't call method foo of undefined".

Would be badass.