Closed mfikes closed 9 years ago
While technically load-file
can take a string identifying a resource on the classpath at the moment I consider this an invalid usage of load-file
as it doesn't match Clojure semantics. Did you try (load-file "src/foo/bar.cljs")
?
@swannodette After resetting my simulator (ensuring output directory is completely deleted), (load-file "src/foo/bar.cljs")
fails in the same way (details below). If you believe that this variant should be considered valid usage, let me know and I'll put together a minimal repro with Quick Start. If not, we can close this issue as being invalid.
To quit, type: :cljs/quit
cljs.user=> (load-file "src/foo/bar.cljs")
nil
cljs.user=> (foo.bar/call-me)
Error: 1 is not ISeqable
Exception in thread "main" java.io.FileNotFoundException: /Volumes/Ambly-0A1169FA/foo/bar.cljs (No such file or directory), compiling:(/private/var/folders/nm/97bx7f_n31z2t2g_gf2bn90w0h013l/T/form-init6679429748958357965.clj:1:142)
at clojure.lang.Compiler.load(Compiler.java:7142)
at clojure.lang.Compiler.loadFile(Compiler.java:7086)
at clojure.main$load_script.invoke(main.clj:274)
at clojure.main$init_opt.invoke(main.clj:279)
at clojure.main$initialize.invoke(main.clj:307)
at clojure.main$null_opt.invoke(main.clj:342)
at clojure.main$main.doInvoke(main.clj:420)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:383)
at clojure.lang.AFn.applyToHelper(AFn.java:156)
at clojure.lang.Var.applyTo(Var.java:700)
at clojure.main.main(main.java:37)
Caused by: java.io.FileNotFoundException: /Volumes/Ambly-0A1169FA/foo/bar.cljs (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at clojure.java.io$fn__8702.invoke(io.clj:229)
at clojure.java.io$fn__8615$G__8606__8622.invoke(io.clj:69)
at clojure.java.io$fn__8676.invoke(io.clj:165)
at clojure.java.io$fn__8628$G__8610__8635.invoke(io.clj:69)
at clojure.java.io$reader.doInvoke(io.clj:102)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at cljs.analyzer$parse_ns$fn__1828.invoke(analyzer.clj:2049)
at cljs.analyzer$parse_ns.invoke(analyzer.clj:2035)
at cljs.analyzer$parse_ns.invoke(analyzer.clj:2026)
at cljs.repl$read_source_map.invoke(repl.clj:218)
at clojure.core$juxt$fn__4211.invoke(core.clj:2440)
at cljs.repl$mapped_stacktrace$iter__3946__3950$fn__3951$fn__3952.invoke(repl.clj:287)
at cljs.repl$mapped_stacktrace$iter__3946__3950$fn__3951.invoke(repl.clj:278)
at clojure.lang.LazySeq.sval(LazySeq.java:40)
at clojure.lang.LazySeq.seq(LazySeq.java:49)
at clojure.lang.RT.seq(RT.java:484)
at clojure.core$seq.invoke(core.clj:133)
at clojure.core$map$fn__4245.invoke(core.clj:2551)
at clojure.lang.LazySeq.sval(LazySeq.java:40)
at clojure.lang.LazySeq.seq(LazySeq.java:49)
at clojure.lang.LazySeq.more(LazySeq.java:85)
at clojure.lang.RT.more(RT.java:607)
at clojure.core$rest.invoke(core.clj:73)
at cljs.repl$mapped_stacktrace.invoke(repl.clj:322)
at ambly.repl.jsc.JscEnv._print_stacktrace(jsc.clj:374)
at cljs.repl$display_error.invoke(repl.clj:402)
at cljs.repl$repl_caught.invoke(repl.clj:696)
at cljs.repl$repl_STAR_$fn__4119$fn__4126.invoke(repl.clj:835)
at cljs.repl$repl_STAR_$fn__4119.invoke(repl.clj:832)
at cljs.compiler$with_core_cljs.invoke(compiler.clj:951)
at cljs.repl$repl_STAR_.invoke(repl.clj:798)
at cljs.repl$repl.doInvoke(repl.clj:914)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at ambly.repl.jsc$_main.invoke(jsc.clj:403)
at clojure.lang.Var.invoke(Var.java:375)
at user$eval5.invoke(form-init6679429748958357965.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6703)
at clojure.lang.Compiler.eval(Compiler.java:6693)
at clojure.lang.Compiler.load(Compiler.java:7130)
... 11 more
Mike-Fikess-MacBook-Pro:Ambly-0A1169FA mfikes$ cd foo
Mike-Fikess-MacBook-Pro:foo mfikes$ ls
bar.cljs.cache.edn bar.js bar.js.map
@mfikes I tested this with Rhino & Node.js REPLs and could not replicate. But yes if you can come up with something minimal open an issue. load-file
issues are blockers for a ClojureScript release.
@swannodette Cool. Able to reproduce: http://dev.clojure.org/jira/browse/CLJS-1183
Confirmed fixed using ClojureScript master.
In Ambly, make
src/foo/bar.cljs
with contentsThen
You can see that the "derived" compiler output is there, but not the file that was loaded:
This is with ClojureScript 0.0-3169. Don't know yet if it is an Ambly or ClojureScript issue, so logging here first.