plexus / chestnut

Application template for Clojure + ClojureScript web apps
Eclipse Public License 1.0
1.32k stars 99 forks source link

Figwheel CIDER middleware doesn't seem to be working. #244

Closed jvargas closed 5 years ago

jvargas commented 5 years ago

Figwheel CIDER middleware doesn't seem to be working.

Template projects created by lein new chestnut pandapp +re-frame +edge fail to produce a working cljs-repl with CIDER.

As i understand it, should be able to get a cljs environment up and running by running (do (go) (cljs-repl)). Compiled js assets go in dev-target/public/js/compiled and there's middleware to expose this. however, this middleware doesn't seem to be working:

$  curl http://localhost:3449/js/compiled/pandapp.js
<div><h1>Figwheel Server: Resource not found</h1><h3><em>Keep on figwheelin'</em></h3></div>

and a similar 404 from the browser console when viewing localhost:3449.

Environment is jvm 1.11, CIDER 0.21.0, nrepl/nrepl 0.6.0.

dpsutton commented 5 years ago

Just a point: this isn't CIDER middleware and I suspect this same issue will happen without CIDER in the mix. It's the middleware used in the dev setup.

(defn dev-system []
  (let [config (config)]
    (assoc ({{project-ns}}.application/app-system config)
           :middleware (new-middleware
                        {:middleware (into [[wrap-file "dev-target/public"]]
                                           (:middleware config))})
           :figwheel-system (fw-sys/figwheel-system (fw-config/fetch-config))
           :css-watcher (fw-sys/css-watcher {:watch-paths ["resources/public/css"]}){{{extra-dev-components}}})))
featheredtoast commented 5 years ago

3449 is just the port that figwheel uses to communicate - don't use that port. There's a separate port (10555) for the actual app...

When starting a new app, there's a print statement in the logs to tell you where to connect:

...
Figwheel: Starting CSS Watcher for paths  ["resources/public/css"]
Started myapp on http://localhost:10555
:started