lein-figwheel icon indicating copy to clipboard operation
lein-figwheel copied to clipboard

Circular ns dependency leads to wrong error

Open deg opened this issue 7 years ago • 3 comments

Running figwheel, I accidentally created a circular namespace dependency between two of my files. Rather than the usual, somewhat friendly, error that I expected from Clojure, I triggered a stack overflow in Figwheel, mostly in figwheel.client.file-reloading/build-topo-sort.

Of course, Figwheel is well within its rights to barf at the invalid input I gave it, but it would be more beginner-friendly to catch this situation.

deg avatar Apr 11 '18 19:04 deg

I just had a similar case. I was adding a new dependency and added some code, while creating a circular dependency. Then I got a stacktrace that looked recursive and at the end was a message that it could not find net.cgrand.regex.clj on the classpath.

It left me very confused and I spent some time until I took my changes back, found this issue and figured out the CD was the problem.

Also, If I remove the code and the dependency and only leave the require statements in the code that lead to the CD I get the expected error message.

sveri avatar Apr 17 '18 07:04 sveri

Possibly related? I was having trouble with figwheel + cider + luminus, because source dirs were nested and the cljs directory wasn't included as a source dir. @deg @sveri maybe see if that's the case in your projects, and if so, if adding the cljs dir fixes it?

https://github.com/luminus-framework/luminus-template/issues/356

eggsyntax avatar Apr 18 '18 14:04 eggsyntax

@eggsyntax My cljs directory was contained as a source dir, so that was not the problem.

sveri avatar Apr 18 '18 14:04 sveri