We're updating the issue view to help you get more done. 

Mishandling of :npm-deps Boolean value computing upstream deps

Description

cljs.closure/compute-upstream-npm-deps mishandles the case when the :npm-deps value is not a map but a Boolean.

Repro

deps.edn

1 2 {:deps {org.clojure/clojurescript {:mvn/version "1.10.439"} upstream-lib {:local/root "./upstream-lib"}}}

upstream-lib/deps.edn

1 {:paths ["."]}

upstream-lib/deps.cljs

1 {:npm-deps {:left-pad "1.3.0"}}

Then executing

1 clj -Srepro -m cljs.main -co '{:install-deps true}'

results in

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 Exception in thread "main" java.lang.IllegalArgumentException: contains? not supported on type: java.lang.Boolean at clojure.lang.RT.contains(RT.java:846) at clojure.core$contains_QMARK_.invokeStatic(core.clj:1484) at clojure.core$contains_QMARK_.invoke(core.clj:1476) at cljs.closure$compute_upstream_npm_deps$fn__5780.invoke(closure.clj:2343) at clojure.core.protocols$iter_reduce.invokeStatic(protocols.clj:49) at clojure.core.protocols$fn__7839.invokeStatic(protocols.clj:75) at clojure.core.protocols$fn__7839.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$compute_upstream_npm_deps.invokeStatic(closure.clj:2340) at cljs.closure$compute_upstream_npm_deps.invoke(closure.clj:2333) at cljs.closure$maybe_install_node_deps_BANG_.invokeStatic(closure.clj:2475) at cljs.closure$maybe_install_node_deps_BANG_.invoke(closure.clj:2473) at cljs.closure$build$fn__6035.invoke(closure.clj:2927) at clojure.lang.AFn.applyToHelper(AFn.java:154) at clojure.lang.AFn.applyTo(AFn.java:144) at clojure.core$apply.invokeStatic(core.clj:659) at clojure.core$update_in$up__6562.invoke(core.clj:6105) at clojure.core$update_in.invokeStatic(core.clj:6106) at clojure.core$update_in.doInvoke(core.clj:6092) at clojure.lang.RestFn.invoke(RestFn.java:445) at clojure.lang.Atom.swap(Atom.java:65) at clojure.core$swap_BANG_.invokeStatic(core.clj:2346) at clojure.core$swap_BANG_.invoke(core.clj:2337) at cljs.closure$build.invokeStatic(closure.clj:2924) at cljs.closure$build.invoke(closure.clj:2903) at cljs.build.api$build.invokeStatic(api.clj:208) at cljs.build.api$build.invoke(api.clj:189) at cljs.build.api$build.invokeStatic(api.clj:195) at cljs.build.api$build.invoke(api.clj:189) at cljs.repl.browser$setup$fn__7555.invoke(browser.clj:352) at cljs.repl.browser$setup.invokeStatic(browser.clj:332) at cljs.repl.browser$setup.invoke(browser.clj:331) at cljs.repl.browser.BrowserEnv._setup(browser.clj:367) at cljs.repl$setup.invokeStatic(repl.cljc:129) at cljs.repl$setup.invoke(repl.cljc:128) at cljs.cli$default_main$fn__6916.invoke(cli.clj:354) at cljs.compiler$with_core_cljs.invokeStatic(compiler.cljc:1416) at cljs.compiler$with_core_cljs.invoke(compiler.cljc:1405) 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:351) at cljs.cli$default_main.invoke(cli.clj:324) at cljs.cli$null_opt.invokeStatic(cli.clj:422) at cljs.cli$null_opt.invoke(cli.clj:419) at cljs.cli$main.invokeStatic(cli.clj:646) at cljs.cli$main.doInvoke(cli.clj:635) 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)

Note that this is not a really a regression introduced with CLJS-2904 because you can repro it with 1.10.339 via by executing:

1 clj -Srepro -m cljs.main -co '{:install-deps true :npm-deps false}'

Workaround

Specify :npm-deps as an empty map instead of letting it default to true

Environment

None

Status

Assignee

David Nolen

Reporter

Mike Fikes

Labels

None

Approval

None

Patch

None

Priority

Blocker