thanks, that worked
I am having trouble getting this up and running...
prompt@prompt:~/projects/example$ ./task dev
tailwindcss 1.9.6
๐ Building: tailwind.css
โ
Finished in 5.7 s
๐ฆ Size: 2.33MB
๐พ Saved to www/css/main.css
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See <http://www.slf4j.org/codes.html#StaticLoggerBinder> for further details.
Nov 10, 2020 12:37:59 PM io.undertow.Undertow start
INFO: starting server: Undertow - 2.1.3.Final
Nov 10, 2020 12:38:00 PM org.xnio.Xnio <clinit>
INFO: XNIO version 3.8.0.Final
Nov 10, 2020 12:38:00 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.8.0.Final
Nov 10, 2020 12:38:00 PM org.jboss.threads.Version <clinit>
INFO: JBoss Threads version 3.1.0.Final
shadow-cljs - server version: 2.11.6 running at <http://localhost:9630>
shadow-cljs - nREPL server started on port 7888
Execution error (BindException) at <http://sun.nio.ch.Net/bind0|sun.nio.ch.Net/bind0> (Net.java:-2).
Address already in use
Full report at:
/tmp/clojure-742481856711000833.edn
prompt@prompt:~/projects/example$
prompt@prompt:~$ lsof -i :8080
prompt@prompt:~$
I don't seem to be having anything running on port 8080
openjdk 11.0.9 2020-10-20
OpenJDK Runtime Environment (build 11.0.9+11-Ubuntu-0ubuntu1.20.04)
OpenJDK 64-Bit Server VM (build 11.0.9+11-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)
jason@
Clojure 1.10.1
I am following this guide https://findka.com/biff/#introduction
hm, haven't seen that problem come up before. You can use a different port by putting this in config/main.edn
:
{...
:dev {:biff.web/port 8081
...}}
Let me know if that works. the help message will still say "go to localhost:8080" fyi because it's hardcoded, so just ignore thatLet me try it out
(edited cause I see the log says ubuntu 20.04)
Yep
Funny, I actually do not have :biff.web/port 8081
in web dev config. Let me add it
that's expected; it's set to 8080 by default in the code
Makes sense
Looking much better...
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See <http://www.slf4j.org/codes.html#StaticLoggerBinder> for further details.
Nov 10, 2020 1:26:59 PM io.undertow.Undertow start
INFO: starting server: Undertow - 2.1.3.Final
Nov 10, 2020 1:26:59 PM org.xnio.Xnio <clinit>
INFO: XNIO version 3.8.0.Final
Nov 10, 2020 1:26:59 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.8.0.Final
Nov 10, 2020 1:26:59 PM org.jboss.threads.Version <clinit>
INFO: JBoss Threads version 3.1.0.Final
shadow-cljs - server version: 2.11.6 running at <http://localhost:9630>
shadow-cljs - nREPL server started on port 7888
Go to <http://localhost:9630> -> "Builds" -> "start watch" -> "Dashboard".
After the build finishes, go to <http://localhost:8080>.
Connect your editor to nrepl port 7888.
See `./task help` for a complete list of commands.
System started.
Although it reports I should go to 8080. I changed the port to 8085
Perfect. looks like it worked. that's what I meant by the message being hardcoded--I just have (println "... go to <http://localhost:8080>")
in the code, it doesn't actually look at what port you used. so if you go to http://localhost:8085 you should see a sign-in form
I'd also be interested to see if you can get some other program to run on port 8080, e.g. python3 -m http.server 8080
ah perfect
Nope can't get that to work
prompt@prompt:~/projects/example$ python3 -m http.server 8080
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/usr/lib/python3.8/http/server.py", line 1294, in <module>
test(
File "/usr/lib/python3.8/http/server.py", line 1249, in test
with ServerClass(addr, HandlerClass) as httpd:
File "/usr/lib/python3.8/socketserver.py", line 452, in __init__
self.server_bind()
File "/usr/lib/python3.8/http/server.py", line 1292, in server_bind
return super().server_bind()
File "/usr/lib/python3.8/http/server.py", line 138, in server_bind
socketserver.TCPServer.server_bind(self)
File "/usr/lib/python3.8/socketserver.py", line 466, in server_bind
self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use
I have something running on 8080
Doing some detective work... Thank you. ๐
I think jetty server keeps restarting on 8080
tcp6 0 0 127.0.0.1:8080 :::* LISTEN 26610/java
All good, I will keep using 8085
for now.
I tried biff and ran into this error right after generating a new project โRefused to execute script from โhttp://localhost:8080/cljs/app/main.jsโ because its MIME type (โtext/htmlโ) is not executable, and strict MIME type checking is enabled.โ
that was fast ๐
Did the cljs build finish (at localhost:9630) before you signed in? is there a file at www/cljs/app/main.js
?
If the file isn't there, Biff would return the 404 page which would produce the error you have.
Good catch. The file is missing. I had expected a 404 in the console and not a content type mismatch.
I was mislead by that login page existingโฆ
IMHO the error in biff is that it should return a 404 if anything under /cljs/
is not found.
Sounds reasonable. Technically I believe it does return a 404, but the body and content type is for the html not found page, so yeah, confusing. (edit: actually I guess it would've returned a 200 with /app/index.html
due to the :biff.http/spa-path
option. it would've returned the 404 page in the MPA template). I think I'll add a :biff.http/asset-paths
config option which defaults to #{"/cljs/" "/js/" "/css/"}
. I'll also add a message to /app/index.html
so instead of just Loading...
, it also says something like "If you see this page for more than a second, go to localhost:9630 etc"
(also, you probably have figured this out already--but the login page exists since it's just a static html page, not rendered with cljs)