<< Back to previous view

[CLJS-2737] No such file when using fs from ns form Created: 13/Apr/18  Updated: 12/May/18  Resolved: 12/May/18

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 1.10.238
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Andrea Richiardi Assignee: Unassigned
Resolution: Not Reproducible Votes: 0
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.



 Comments   
Comment by Thomas Heller [ 14/Apr/18 3:04 AM ]

Probably duplicate: https://dev.clojure.org/jira/browse/CLJS-2724

Comment by Andrea Richiardi [ 17/Apr/18 11:38 AM ]

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

Comment by Mike Fikes [ 12/May/18 8:14 AM ]

No longer reproducible on master.

Generated at Sun May 19 09:54:59 CDT 2019 using JIRA 4.4#649-r158309.