Closed miikka closed 5 years ago
This template requires you to start the server using lein run
and it will be available on port 3000
by default. Figwheel is only used for compiling ClojureScript, and the server it runs should not be used.
Note that if you want to make a front-end only project you can use the reagent frontend template by running lein new reagent-frontend foo
. That project will be setup to be accessible via Figwheel server.
Okay, but the same problem happens if I start the server with lein run
and go to http://localhost:3000/
. Thus I suggest re-opening.
Also, if the Figwheel server should not ever be used, maybe that should be mentioned in the README of the generated template. Now it only says that you might want to not use if you're using websockets or doing something special otherwise.
You're right, I just tested locally and can see the behavior as well. It looks like using {:data {:middleware middleware}}
doesn't load the resources, when I switch to wrap the entire reitit-ring/ring-handler
with the middleware prone works as expected.
I'll update the template and add a note in the readme regarding using Figwheel.
Just pushed out a new version with a fix. I also took a second look at Figwheel, and it should actually be safe to use because the handler is explicitly declared in the config in project.clj
as :ring-handler {{project-ns}}.handler/app
. So, Figwheel will use the same handler as the Ring server started by lein run
.
Now it works! Thanks.
Whenever I have exceptions, I'm getting an empty page in the browser and 404 errors in the browser console about
prone.js
,prone-lib.js
, andprone.css
.Steps to reproduce:
lein new reagent foo
src/clj/foo/handler.clj
and add(throw (Exception. "hello"))
to the body ofindex-handler
.lein figwheel
.http://localhost:3449
with a browserWhat happens: Browser shows a blank page and there are 404 errors in the console. What I expected: Browsers shows a page full of information about the exception.