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

0 votes
in ClojureScript by
The following


clojure -m cljs.main -co '{:npm-deps {"slate" "0.33.6"} :install-deps true}' -e "(require 'slate)"


generates the following exception


Exception in thread "main" java.lang.IllegalArgumentException: /Users/mfikes/node_modules/immutable/dist/immutable.js is not a relative path
    at clojure.java.io$as_relative_path.invokeStatic(io.clj:414)
    at clojure.java.io$file.invokeStatic(io.clj:426)
    at clojure.java.io$file.invoke(io.clj:418)
    at cljs.closure$write_javascript.invokeStatic(closure.clj:1857)
    at cljs.closure$write_javascript.invoke(closure.clj:1850)
    at cljs.closure$process_js_modules$fn__5815.invoke(closure.clj:2560)
    at clojure.lang.ArrayChunk.reduce(ArrayChunk.java:63)
    at clojure.core.protocols$fn__7847.invokeStatic(protocols.clj:136)
    at clojure.core.protocols$fn__7847.invoke(protocols.clj:124)
    at clojure.core.protocols$fn__7807$G__7802__7816.invoke(protocols.clj:19)
    at clojure.core.protocols$seq_reduce.invokeStatic(protocols.clj:31)
    at clojure.core.protocols$fn__7835.invokeStatic(protocols.clj:75)
    at clojure.core.protocols$fn__7835.invoke(protocols.clj:75)
    at clojure.core.protocols$fn__7781$G__7776__7794.invoke(protocols.clj:13)
    at clojure.core$reduce.invokeStatic(core.clj:6748)
    at clojure.core$reduce.invoke(core.clj:6730)
    at cljs.closure$process_js_modules.invokeStatic(closure.clj:2559)
    at cljs.closure$process_js_modules.invoke(closure.clj:2518)
    at cljs.closure$handle_js_modules.invokeStatic(closure.clj:2672)
    at cljs.closure$handle_js_modules.invoke(closure.clj:2633)
    at cljs.repl$evaluate_form.invokeStatic(repl.cljc:508)
    at cljs.repl$evaluate_form.invoke(repl.cljc:484)
    at cljs.repl$eval_cljs.invokeStatic(repl.cljc:672)
    at cljs.repl$eval_cljs.invoke(repl.cljc:665)
    at cljs.repl$run_inits$fn__6480.invoke(repl.cljc:823)
    at cljs.repl$run_inits.invokeStatic(repl.cljc:821)
    at cljs.repl$run_inits.invoke(repl.cljc:814)
    at cljs.cli$default_main$fn__6799.invoke(cli.clj:340)
    at cljs.compiler$with_core_cljs.invokeStatic(compiler.cljc:1285)
    at cljs.compiler$with_core_cljs.invoke(compiler.cljc:1274)
    at cljs.compiler.api$with_core_cljs.invokeStatic(api.clj:50)
    at cljs.compiler.api$with_core_cljs.invoke(api.clj:34)
    at cljs.compiler.api$with_core_cljs.invokeStatic(api.clj:42)
    at cljs.compiler.api$with_core_cljs.invoke(api.clj:34)
    at cljs.cli$default_main.invokeStatic(cli.clj:326)
    at cljs.cli$default_main.invoke(cli.clj:299)
    at cljs.cli$null_opt.invokeStatic(cli.clj:394)
    at cljs.cli$null_opt.invoke(cli.clj:391)
    at cljs.cli$main.invokeStatic(cli.clj:612)
    at cljs.cli$main.doInvoke(cli.clj:601)
    at clojure.lang.RestFn.applyTo(RestFn.java:139)
    at clojure.core$apply.invokeStatic(core.clj:659)
    at clojure.core$apply.invoke(core.clj:652)
    at cljs.main$_main.invokeStatic(main.clj:61)
    at cljs.main$_main.doInvoke(main.clj:52)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.lang.Var.applyTo(Var.java:702)
    at clojure.core$apply.invokeStatic(core.clj:657)
    at clojure.main$main_opt.invokeStatic(main.clj:317)
    at clojure.main$main_opt.invoke(main.clj:313)
    at clojure.main$main.invokeStatic(main.clj:424)
    at clojure.main$main.doInvoke(main.clj:387)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.lang.Var.applyTo(Var.java:702)
    at clojure.main.main(main.java:37)

2 Answers

0 votes
by

Comment made by: mfikes

This failure was evidently related to the fact that I had a {{node_modules}} directory sitting in my home directory. Removing it caused the issue above to go away.

Perhaps this is the result of the processing marching outward (I was in a subdirectory of my home directory). If this is a possibility, maybe the ClojureScript compiler can itself handle this corner case? (Or is this just a user error?)

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJS-2756 (reported by mfikes)
...