Fork me on GitHub

To describe my problem in more detail: The REPL compiles my CLJS and starts the browser off at localhost:3449 as expected, and the compiled js is shown in the browser. The REPL never gets a prompt, though. There are some errors in the browser console, but they seem insignificant - something about not having a favicon, something about not being able to load source-maps. Usually when I’ve started localhost:3449 up for an app, and the browser cannot connect to the REPL (because it’s not running), the browser repeatedly states that it’s unable to connect to figwheel. This does not happen here; there are no connection-related messages in the browser console.


I run lein figwheel in the terminal, so the problem is not related to IntelliJ or Cider or whatever.


@reefersleep do you have clj code involved? Did it compile? lein check on your project


Nope, they’re CLJS only - that’s the -frontend part of the reagent-frontend template I’ve used 🙂


lein check yields no response, @mikerod


I did not update dependencies or otherwise manipulate all of those projects in a similar manner at once, so I suspected that maybe I had somehow had something rotten in .m2. Tried deleting it and building anew, no difference.


I also restarted my computer, just for the heck of it. No difference.


Can you run perhaps lein cljsbuild commands successfully. Just seeing if you can reduce it down more. Perhaps not.


To be clear; I was working on one project, and figwheel stopped working for all projects, most of which I haven’t touched in a long time.


lein cljsbuild once seems to work fine.


lein figwheel compiles fine as well, I get all of the usual output, right down to

Successfully compiled "resources/public/js/compiled/bouncy.js" in 3.641 seconds.
Figwheel: Starting CSS Watcher for paths  ["resources/public/css"]
Figwheel: Starting nREPL server on port: 7002
Launching ClojureScript REPL for build: dev
Figwheel Controls:
          (stop-autobuild)                ;; stops Figwheel autobuilder
          (start-autobuild [id ...])      ;; starts autobuilder focused on optional ids
          (switch-to-build id ...)        ;; switches autobuilder to different build
          (reset-autobuild)               ;; stops, cleans, and starts autobuilder
          (reload-config)                 ;; reloads build config and resets autobuild
          (build-once [id ...])           ;; builds source one time
          (clean-builds [id ..])          ;; deletes compiled cljs target files
          (print-config [id ...])         ;; prints out build configurations
          (fig-status)                    ;; displays current state of system
  Switch REPL build focus:
          :cljs/quit                      ;; allows you to switch REPL to another build
    Docs: (doc function-name-here)
    Exit: Control+C or :cljs/quit
 Results: Stored in vars *1, *2, *3, *e holds last exception object
Prompt will show when Figwheel connects to your application


I just never get that prompt, because the connection is never established, as far as I can tell.


The weird thing is that the browser does not report that it failed to establish the connection! (Which it usually does when the app is running in dev mode, and I close my REPL)


OK, so figwheel-main works, and it runs on a different port. I’ll try changing the :server-port for figwheel from the default 3449 to 3450.


No difference.


I’ll try 9500, that’s what figwheel-main uses.


No difference.


@reefersleep using your browser dev tools are you seeing any index page being server at all when you hit your figwheel server port?


If it is serving you some response assets. Look around through the source some. See if you see what you expect there. Figwheel js and your project js files.


Just trying to find where your breakdown is


I see the index page, my js… Not any figwheel stuff, from what I can tell


@mikerod thanks for the suggestions. I haven’t progressed much; been working all day, on my work computer 🙂 I think I’m going to look in it some more, now. It’s curious, for one, that there doesn’t seem to be any figwheel code assets, there seemed to be on my work project.


every so often if a figwheel thing fails too early on it can be difficult to get any debugging info from it


clj compilation failures tend to be quite opaque on startup


cljs ones I think tend to be a bit more clearly stated


The thing is, it’s a system-wide thing, it seems. If I do lein new reagent-frontend my-new-project and cd into that, and lein figwheel, I get exactly the same problem.


That’s why I thought maybe it was a port thing. I mean, I don’t know how, but maybe I’d messed up some routing in my system…. ????


Grasping at straws here


The my-new-project I just created has figwheel code loaded into the browser, but still does not connect to the repl.


I tried lein new figwheel hello-world, and this manages to connect to the repl! Now I just have to figure out what the difference is.


There seem to be so few differences between these two things, and yet it’s taking so long to sort it out. I give up. I’m going to create a new application with lein new figwheel and move whatever code I want to work with in there. I’ve been in these situations before, and it’s maybe the suckiest side of Clojure - my tools or build chain just stops working for strange, indecipherable reasons, and I spend wayyyy too long trying to figure out why.