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

0 votes
in ClojureScript by

clojurescript silently ignores missing externs files possibly leading a developer to chase their tail.

Presently it can be very confusing using advanced compilation if you have made a mistake in the path name of one of your :externs files. This patch makes the compiler print a warning on stderr so you can quickly determine the cause of the broken advanced compilation output.

As a side effect, when doing a basic lein-cljsbuild a warning is always printed:

WARNING: js resource path closure-js/externs does not exist

This is because lein-cljsbuild quietly adds this extra path to your :externs listing without you knowing.

9 Answers

0 votes
by

Comment made by: dnolen

You need to bind to }, or just print to it directly a la {{cljs.util/debug-prn}}.

0 votes
by

Comment made by: retrogradeorbit

I did bind out to err. Check the patch.

0 votes
by

Comment made by: dnolen

Crispin, oops sorry you are correct. Thanks.

0 votes
by
0 votes
by

Comment made by: dnolen

The solution does not work for cljsbuild. It's unclear why there so much machinery in place over the approach taken for {{deps.clj}}.

0 votes
by

Comment made by: dnolen

Stalled on this cljsbuild issue https://github.com/emezeske/lein-cljsbuild/issues/383

0 votes
by

Comment made by: retrogradeorbit

This lein-cljsbuild issue is what made me make it just a warning initially, and not a hard error like raising IllegalArgumentException does. Though I agree it should be a hard error. If we start with a warning, it enables the immediate problem for the developer to be resolved, and leaves a wart that the cljs-build project can then see that need fixing on their end. Then when that end is fixed it could be made a hard error. If cljsbuild is fixed fairly soon then all is well, but if it takes a long time, a warning might be a good first step.

0 votes
by

Comment made by: mfikes

Patch no longer applies. (Also it doesn't work with {{git am}}—see https://clojurescript.org/community/patches.)

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