emezeske / lein-cljsbuild

Leiningen plugin to make ClojureScript development easy.
Other
1.1k stars 151 forks source link

Circular dependencies : Warn user when a namespace requires itself #485

Closed Frozenlock closed 6 years ago

Frozenlock commented 6 years ago

When a namespace requires itself, the compilation hangs without an error message. It would be nice to either throw an error, or at least print a warning message to the user.

mneise commented 6 years ago

@Frozenlock Would you mind providing an example to reproduce this problem? When I tried this, I got an exception during compilation as expected.

For example, have a look at the core.cljs file in the none example project and change the first line to:

(ns none.core
  (:require [none.core]))

Then run lein cljsbuild once and you should get an exception stating Caused by: clojure.lang.ExceptionInfo: Assert failed: Circular dependency detected, none.core -> none.core.

Frozenlock commented 6 years ago

Correct, can't reproduce with the newer versions.