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

No such file when using fs from ns form

Description

With a file like this:

1 2 3 4 5 6 (ns cli-repro.core (:require fs)) (enable-console-print!) (println "ls .:\n" (fs/lstatSync "."))

And a cljsc.edn file like:

1 2 3 4 {:main cli-repro.core :verbose true :optimizations :simple :target :nodejs}

This fails:

clojure -m "cljs.main" -v -co "cljsc.edn" -c cli-repro.core

With:

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 Caused by: clojure.lang.ExceptionInfo: No such namespace: fs, could not locate fs.cljs, fs.cljc, or JavaScript source providing "fs" in file /home/arichiardi/tmp/cli-repros/src/cli_repro/core.cljs {:tag :cljs/analysis-error} at clojure.core$ex_info.invokeStatic(core.clj:4754) at clojure.core$ex_info.invoke(core.clj:4754) at cljs.analyzer$error.invokeStatic(analyzer.cljc:697) at cljs.analyzer$error.invoke(analyzer.cljc:693) at cljs.analyzer$error.invokeStatic(analyzer.cljc:695) at cljs.analyzer$error.invoke(analyzer.cljc:693) at cljs.analyzer$analyze_deps.invokeStatic(analyzer.cljc:2129) at cljs.analyzer$analyze_deps.invoke(analyzer.cljc:2103) at cljs.analyzer$ns_side_effects.invokeStatic(analyzer.cljc:3476) at cljs.analyzer$ns_side_effects.invoke(analyzer.cljc:3471) at cljs.analyzer$analyze_STAR_$fn__2510.invoke(analyzer.cljc:3596) at clojure.lang.PersistentVector.reduce(PersistentVector.java:341) at clojure.core$reduce.invokeStatic(core.clj:6762) at clojure.core$reduce.invoke(core.clj:6745) at cljs.analyzer$analyze_STAR_.invokeStatic(analyzer.cljc:3596) at cljs.analyzer$analyze_STAR_.invoke(analyzer.cljc:3586) at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:3616) at cljs.analyzer$analyze.invoke(analyzer.cljc:3598) at cljs.compiler$emit_source.invokeStatic(compiler.cljc:1386) at cljs.compiler$emit_source.invoke(compiler.cljc:1365) at cljs.compiler$compile_file_STAR_$fn__3672.invoke(compiler.cljc:1467) at cljs.compiler$with_core_cljs.invokeStatic(compiler.cljc:1285) at cljs.compiler$with_core_cljs.invoke(compiler.cljc:1274) at cljs.compiler$compile_file_STAR_.invokeStatic(compiler.cljc:1451) at cljs.compiler$compile_file_STAR_.invoke(compiler.cljc:1444) at cljs.compiler$compile_file$fn__3702.invoke(compiler.cljc:1547) ... 43 more

Note that it works with js/require.

Environment

None

Status

Assignee

Unassigned

Reporter

Andrea Richiardi

Labels

None

Approval

None

Patch

None

Affects versions

1.10.238

Priority

Major