Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by

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.

5 Answers

0 votes
by

Comment made by: mfikes

Cannot repro with 1.9.908 nor 1.9.946:

{{src/itself/core.cljs}}:

(ns itself.core (:require itself.core))

$ java -cp cljs.jar:src clojure.main -m cljs.repl.node ClojureScript Node.js REPL server listening on 54877 To quit, type: :cljs/quit cljs.user=> (require 'itself.core) clojure.lang.ExceptionInfo: Assert failed: Circular dependency detected, cljs.user -> itself.core -> itself.core

0 votes
by

Comment made by: frozenlock

I still get the same behavior with 1.9.946.
Tried with figwheel and uberjar.
Both hang without an error message.

Could it be a problem with the toolchain, say Leiningen?

0 votes
by

Comment made by: mfikes

Yes. With Figwheel, I'd try disabling {{:autoload}} (see https://github.com/bhauman/lein-figwheel/wiki/Configuration-Options#client)

If that allows you to isolate it to Figwheel, perhaps this JIRA can be closed.

0 votes
by

Comment made by: frozenlock

This wouldn't change much in this case : it's hanging when running Figwheel or Uberjar because it can't complete the cljs compilation.

I've tested with lein-cljsbuild and I have the same issue.
I'll check with the cljsbuild team if the problem is on their side.

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJS-2363 (reported by alex+import)
...