Fork me on GitHub
#figwheel
<
2020-05-01
>
reefersleep06:05:03

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.

reefersleep06:05:31

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

mikerod09:05:07

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

reefersleep10:05:25

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

reefersleep10:05:39

lein check yields no response, @mikerod

reefersleep10:05:24

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.

reefersleep10:05:57

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

mikerod10:05:02

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

reefersleep10:05:05

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.

reefersleep10:05:35

lein cljsbuild once seems to work fine.

reefersleep10:05:09

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

reefersleep10:05:25

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

reefersleep10:05:48

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)

reefersleep10:05:48

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.

reefersleep10:05:44

No difference.

reefersleep10:05:51

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

reefersleep10:05:23

No difference.

mikerod12:05:56

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

mikerod12:05:39

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.

mikerod12:05:48

Just trying to find where your breakdown is

reefersleep15:05:17

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

reefersleep20:05:09

@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.

mikerod20:05:01

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

mikerod20:05:10

clj compilation failures tend to be quite opaque on startup

mikerod20:05:20

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

reefersleep20:05:51

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.

reefersleep20:05:35

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…. ????

reefersleep20:05:45

Grasping at straws here

reefersleep20:05:49

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

reefersleep21:05:22

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.

reefersleep22:05:15

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.