Open maacl opened 7 years ago
Same issue for me. Additional info:
When in-ns
ing a namespace, all the locally declared vars are available, but anything else that is brought in by (:require ...)
in that namespace (like cljs-time
) cannot be found. It's as if (:require ...)
never happened. I can, however manually (require '[cljs-time.core :as t])
in the repl and it will then be available.
I have the same problem. Do you found solution for this issue?
I switched to Neovim. :P
We eventually figured this out. This problem occurs when boot-cljs-repl
doesn't get the same compiler options that your main build gets.
To fix this you need to be on 0.4.0-SNAPSHOT
(or current master) as before that there's no way to pass options through to Weasel -> Piggieback -> cljs.repl.
If you're using the right version you can pass the options into start-repl
with :cljs-repl-opts
. We ended up with something like this.
(require
'[adzerk.boot-cljs :refer [cljs]]
'[adzerk.boot-cljs-repl :refer [cljs-repl] :as boot-cljs-repl]
'[clojure.edn]
,,,)
(defn read-edn-file
"Slurp and parse an EDN file"
[path]
(-> path slurp clojure.edn/read-string))
(defn start-repl
"Start a browser connected REPL (Weasel). Like boot-cljs-repl/start-repl but
passes on the compiler options from the given .cljs.edn file."
[]
(boot-cljs-repl/start-repl :cljs-repl-opts
(:compiler-options (read-edn-file "path/to/build.cljs.edn"))))
Expected behavior
=> nil
Actual behavior
Steps to reproduce the problem
boot dev
cider-connect
to nrepl created by boot orboot repl -c
(start-repl)
Switch to source buffer, C-c-v-n to eval namespace declaration or pass namespace declaration to repl.
Project compiles fine with no errors. This issue appears confined to the repl. The namespaces
pm
andchrono
come from two javascript libs included via the foreign-libs compiler option - please see relevant parts of build-boot. If I remove the foreign-libs namespaces everything works as expected.ns form looks as follows:
build.boot contains:
Environment & Version information
CIDER version information
Lein/Boot version
;; BOOT_VERSION=2.6.0
Emacs version
GNU Emacs 25.1.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2016-08-23
Operating system
Ubuntu 16.04