Closed visibletrap closed 7 years ago
When you config outside of leinigen you need to quote your symbols.
Leinigen auto-quotes all raw symbols in the project.clj
On Mon, Jul 3, 2017 at 8:26 PM, Nuttanart Pornprasitsakul < notifications@github.com> wrote:
Normally, I separate Clojure and Clojurescript sources to src/clj and src/cljs. And I set src/clj to leiningen's root-level source-paths and specify src/cljs to source-paths in cljs compiler option. I have been using all these three approach to start figwheel, lein-fighweel, clojure.main repl + sidecar and nrepl + sidecar, everything has been working great.
When I add :preloads flag to cljs compiler config and starts with nrepl. Figwheel shows this warning
WARNING: preload namespace my.namespace does not exist
I also can't load that namespace in the figwheel repl. This issue doesn't appear when using figwheel via lein-figwheel and clojure.main repl.
I have found a workaround for this. Adding src/cljs to root-level source-paths fixes the issue. There's no more warning and the namespace is loaded correctly in figwheel repl.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bhauman/lein-figwheel/issues/566, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAKQJSyf1T-cyqlKwhxgylQpW4Dx99zks5sKYaYgaJpZM4OMxeT .
Thanks for a quick response, Bruce.
I have tried both using config from leiningen ((start-figwheel!)
without any argument) and setting an argument to (start-figwheel! config)
with :preloads '[my.namespace]
. In both cases, there's a warning shows up.
I have created a project to demonstrate this. It's generated by leiningen's figwheel template with a few modifications.
If you have time, can you clone it and try these.
lein figwheel
: no warninglein repl
, then run (fig-start)
: warning shows uplein repl
, then run (fig-start-with-direct-args)
: warning shows upThen try replacing :source-paths ["src/clj" "dev"]
with :source-paths ["src/clj" "dev" "src/cljs"]
lein repl
, then run (fig-start)
: no warninglein repl
, then run (fig-start-with-direct-args)
: no warningThank you so much
This is actually the normal behavior, lein figwheel adds the cljs :source-paths to the lein root :source-paths in the figwheel plugin. When you use figwheel without the plugin you need to add these paths to the :source-paths as you have done in your example.
There is no good way to fix this behavior, as you have to set it up when you start the JVM process.
On Mon, Jul 3, 2017 at 11:08 PM, Nuttanart Pornprasitsakul < notifications@github.com> wrote:
Thanks for a quick response, Bruce.
I have tried both using config from leiningen ((start-figwheel!) without any argument) and setting an argument to (start-figwheel! config) with :preloads '[my.namespace]. In both cases, there's a warning shows up.
I have created a project to demonstrate this https://github.com/visibletrap/preload-can-not-find-ns. It's generated by leiningen's figwheel template with a few modifications https://github.com/visibletrap/preload-can-not-find-ns/commit/0eddbc2db97eda51b84f5b0874a364f00ae2c108 .
If you have time, can you clone it and try these.
- lein figwheel: no warning
- Run lein repl, then run (fig-start): warning shows up
- Run lein repl, then run (fig-start-with-direct-args): warning shows up
Then try replacing :source-paths ["src/clj" "dev"] with :source-paths ["src/clj" "dev" "src/cljs"]
- Run lein repl, then run (fig-start): no warning
- Run lein repl, then run (fig-start-with-direct-args): no warning
Thank you so much
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bhauman/lein-figwheel/issues/566#issuecomment-312769958, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAKQC6TqcfI6rLro65cXMbfEYF8fg9dks5sKay8gaJpZM4OMxeT .
Got it. Thank you so much for the explanation. I'm good with adding path myself.
For people who later landed to this issue, I deleted my example project. I captured changes into images here
Normally, I separate Clojure and Clojurescript sources to
src/clj
andsrc/cljs
. And I setsrc/clj
to leiningen's root-levelsource-paths
and specifysrc/cljs
to source-paths in cljs compiler option. I have been using all these three approach to start figwheel, lein-fighweel, clojure.main repl + sidecar and nrepl + sidecar, everything has been working great.When I add
:preloads
flag to cljs compiler config and starts with nrepl. Figwheel shows this warningI also can't load that namespace in the figwheel repl. This issue doesn't appear when using figwheel via lein-figwheel and clojure.main repl.
I have found a workaround for this. Adding
src/cljs
to root-level source-paths fixes the issue. There's no more warning and the namespace is loaded correctly in figwheel repl.