ClojureScript

No such file when using fs from ns form

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Not Reproducible
  • Affects Version/s: 1.10.238
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

With a file like this:

(ns cli-repro.core
  (:require fs))

(enable-console-print!)

(println "ls .:\n" (fs/lstatSync "."))

And a cljsc.edn file like:

{: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:

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.

Activity

Hide
Thomas Heller added a comment -
Show
Thomas Heller added a comment - Probably duplicate: https://dev.clojure.org/jira/browse/CLJS-2724
Hide
Andrea Richiardi added a comment -

Data point: Juho reported on Slack that it is working for him with `lein`.

Show
Andrea Richiardi added a comment - Data point: Juho reported on Slack that it is working for him with `lein`.
Hide
Mike Fikes added a comment -

No longer reproducible on master.

Show
Mike Fikes added a comment - No longer reproducible on master.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: