cujojs / curl

curl.js is small, fast, extensible module loader that handles AMD, CommonJS Modules/1.1, CSS, HTML/text, and legacy scripts.
https://github.com/cujojs/curl/wiki
Other
1.89k stars 216 forks source link

Curl 0.7.3 hangs on circular dependencies #175

Open dizzib opened 11 years ago

dizzib commented 11 years ago

Curl hangs if module A depends on module B and B depends on A.

Would be better if curl errored or gave a warning.

unscriptable commented 11 years ago

Hey Andy!

Cycle detection logic is something I don't want to add to curl.js. It's something I'd love to add to curl/debug, though. :) Thanks for the reminder.

It is possible to have circular dependencies with AMD modules, but you have to write your modules carefully. If you think you have a good use case for a mutual dependency (A->B and B->A), open another issue and I'll show you how to do it. You can also ask on the google group: https://groups.google.com/d/forum/cujojs

Regards,

-- John