reagent-template
reagent-template copied to clipboard
Figwheel hangs when trying to run on a clean app
When I run lein figwheel, I get "Prompt will show when Figwheel connects to your application" and it sits and hangs for an infinite amount of time. When I run it with lein run, the server tells me that the clojurescript has not been compiled and that I need to run figwheel.
Even after running lein clean first, the figwheel wont connect to my application. Also when Figwheel is hanging, I can access the server but I still get the bit of clojure that is saying that I need to compile my clojurescript. If i just build my own project or use lein figwheel or a re-frame template, everything seems to work correctly without problems. It is only with the reagent template that I seem to be having this issue.
I am on windows 10 with java 1.8 and the latest version of lein.
Edit: I was able to access the figwheel repl and get past the "Prompt will show when Figwheel connects to your application" if I run both lein run and lein figwheel in two separate cmd prompts, however, my clojurescript still does not compile correctly.
Unfortunately, I don't have a Windows machine to test with. I tried locally on MacOS and was not able to replicate the issue. The only thing I can think of would be to check if you have any plugins in your .lein/profiles.clj
that might be causing a problem.
I am having the same issue on Ubuntu Linux, Java 1.8
Could it be something with firewall properties?
I don't think so, but how would I check?
You'd have to check your iptables rules.
Ah ok, that can't be it. I am on a laptop on my home network and haven't set up any rules. iptables -L
shows it is accepting anything from anywhere! :scream: :laughing:
Yeah that was kind of a long shot. Localhost is typically not blocked. It might be worth checking on Clojurians Slack or opening an issue for lein-figwheel, as it appears to be a Figwheel specific issue.
Sorry, I didn't read the issue properly late last night. For me it is actually just lein figwheel devcards
that hangs. lein figwheel
works fine. Probably a different thing.
Hmm, can't reproduce that either. I start the app with
lein figwheel devcards
and then I'm able to navigate to http://localhost:3449/cards
Ah, I didn't realize I needed to go to that path. Thanks for your help and really sorry for wasting your time! :confused:
No worries, glad everything is working. 👍
I had a similar issue and I realized that it occurs because it's necessary to create a html page that imports the compiled javascript as defined on project.cls configuration.
This is my configuration:
:builds [{
:id "dev"
:source-paths ["src"]
:figwheel true
:compiler {
:main clojurescript-tdd-application.core
:asset-path "cljs/out"
:output-to "resources/public/cljs/main.js"
:output-dir "resources/public/out"
:source-map-timestamp true
}}
This way you need to import the file main.js
on your index.html
as defined on :output-to
. After that you just need to run lein figwheel
or the command you use to run figwheel and then type localhost:3449 on your browser. This worked for me.
This page has a better description on how to solve it as well.
@FFrancieli do you think there's anything that could be changed in the template to make things smoother here?
Same issue on OSX. @FFrancieli can you offer a bit more about your workaround? Is there a fix in the works?
Having this issue myself on Windows 10
I had this issue on OSX and eventually figured out the problem (for me) was uMatrix. The url in the figwheel output was http://0.0.0.0:3449 and then uMatrix blocked an XHR request to "localhost".
Have same problem on Win10. 'lein figwheel' - stuck (but woke up after visiting localhost:3449) 'lein repl' -> (start-server) - works
On the other hand, 'lein figwheel' works when created from template 'reagent-frontend'. Hope this can clear something, i am not sure for now how all this works.
Looks like my problem was related to devcards only. I was able to refute it with couple of small fixes. I've raised pr for them.
Thanks, just pushed out a new version with the PR fixes.