This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-10
Channels
- # beginners (151)
- # cider (41)
- # cljdoc (7)
- # cljs-dev (6)
- # clojure (92)
- # clojure-dev (5)
- # clojure-italy (26)
- # clojure-losangeles (1)
- # clojure-nl (10)
- # clojure-russia (3)
- # clojure-spec (23)
- # clojure-uk (82)
- # clojurescript (56)
- # clojutre (1)
- # core-async (3)
- # cursive (15)
- # datomic (26)
- # editors (3)
- # emacs (3)
- # events (2)
- # figwheel-main (192)
- # fulcro (66)
- # leiningen (12)
- # mount (1)
- # off-topic (131)
- # portkey (6)
- # re-frame (38)
- # reagent (10)
- # reitit (7)
- # ring-swagger (55)
- # shadow-cljs (21)
- # spacemacs (11)
- # tools-deps (48)
Hi, is there please a version of https://github.com/bhauman/figwheel-template using figwheel-main?
Hi! Just created a figwheel-main project by doing lein new figwheel-main client2
, but getting exception when running lein fig:build
aftterwards. Running on windows. Exception is Unable to dynamicly load figwheel.server.jetty-websocket/run-server {:not-loaded figwheel.server.jetty-websocket/run-server}
So, basically you have to put your cljs-dependencies in deps.edn, and definitely not put them in project.clj, it seems?
On windows, if I put the same dependency in project.clj and in deps.edn, I get this error: `Caused by: java.io.IOException: The filename, directory name, or volume label syntax is incorrect at java.io.WinNTFileSystem.canonicalize0(Native Method) at java.io.WinNTFileSystem.canonicalize(Unknown Source)`
@U21QNFC5C I’d like to track this down
deps.edn doesn’t have any effect on windows right, because the Clojure tools aren’t available there yet correct?
I pretty much spent the last 4 hours trying to get started on windows, there were several things stopping me.
Current finding: the template comes with 0.1.5, which does not work with less-than-four-of-these. But with 0.1.9, it works
so this will be kinda badly structured as a feedback right now, I could make a list and post it again in a new thread
when you use the template it makes a project.clj file that depends on figwheel-main 0.1.5?
I've been thoroughly confused during the day, so don't listen to me until I've summarized here 🙂
Nice synchronicity 🙂. lein new figwheel-main
works at my Linux machine, but I miss the server-side part there -- seems just like a client-side project...
@perglr I think that's by design. You could check this out https://github.com/pesterhazy/cljs-spa-example
A nice one! I like having the separation of concerns in the template, however I would love e.g. a switch --server
, which would generate the server-side code, like the old figwheel-template
did... Or what is the best practice now, @bhauman?
Hmm, I am now looking at the old template and it does not have the server-side, as well. Sorry for confusion, this must have been different template...
clj -A:new figwheel-main form-validator-demo --reagent
- what is wrong with this command?
Exception in thread "main" clojure.lang.ExceptionInfo: Project names must be valid qualified or multi-segment Clojure symbols. {:project-name "form-validator-demo"}
Not sure if it is figwheel template issue or clj -A:new, it is my first project with cljprobably the dashes?
ah ignore what I said
form-validator.demo
Clojure discourages (but doesn't forbid) single-segment namespace names like "hello". Apparently clj-new enforces that convention
yup that should work
you can pass form-validator-demo
to lein and it will work and generate form-validator-demo.core
and since most of the time when I use a template, I’m using it on a temp project to validate behavior, I think its a bit overkill
oh and it even create folder orm-validator-demo.core
instead of orm-validator-demo
which I would expect
but you can use lein new figwheel-main form-validator-demo +deps
and it will do what you want
well I think clj
is a very good tool, and you have to remember that clj-new
isn’t part of clj
you could file an issue with clj new
I see
Funny, Sean has previously been very responsive with suggestions
might to be good to have the argument on record
to me the strongest argument is that one way that templates are used is for temporary throw away projects
and in most clojurescript projects you are creating an application and not a library for others to consume
if would be easy to just print a warning and use XXX.core
if the string contains no dot
yeah that won’t fly either because the feature was put in place to prevent the abundance of .core
files
@kwladyka I think filing an issue - if only for posterity - would help: https://github.com/seancorfield/clj-new/issues
First of all, the flappy sample app points to figwheel-main 0.1.5, which seems to have issues on windows
After fixing that, I came pretty far. My current issue is the same as the one I started with: Unable to dynamicly load figwheel.server.jetty-websocket/run-server {:not-loaded figwheel.server.jetty-websocket/run-server}
`(defproject cse-client "1.0.0" :min-lein-version "2.0.0" :dependencies [[kee-frame "0.2.7"] [org.clojure/clojurescript "1.10.312"] [org.clojure/clojure "1.9.0"] [expound "0.7.1"]] :resource-paths ["resources" "target"] :clean-targets ^{:protect false} ["target/public"] :profiles {:dev {:dependencies [[com.bhauman/figwheel-main "0.1.9"] [com.bhauman/rebel-readline-cljs "0.1.4"] [binaryage/devtools "0.9.10"] [day8.re-frame/re-frame-10x "0.3.3-react16"]]}} :aliases {"fig" ["trampoline" "run" "-m" "figwheel.main"] "fig:build" ["trampoline" "run" "-m" "figwheel.main" "-b" "dev" "-r"]}) `
Unable to dynamicly load
is related to conflicting deps for jetty
certain versions of datomic will conflict and require exclusions
try to get the whole deps tree printed and check if anything else than figwheel needs jetty-websocket/*
I can't remember how to check that in lein anymore
I did a lein deps :tree
now, there are 2 org.eclipse.jetty.websocket deps on root, nothing down the tree
Which makes sense, given that I ran it with zero deps except figwheel, rebel, clojure and cljs
And I do realize that there's a good chance I'm doing something wrong 🙂 Using leiningen 2.8.1, and a pretty stripped down project
@U21QNFC5C this does look like it may be some kind of bug on windows
The thing i found with 0.1.5 was that one-two-three-four works as project folder, one-to-three does not. Super weird, and resulted in that dynamic loading error. It went away when upgrading to 0.1.9, but I'll re-check it soon
no, but I wanted to test if it will work again if I change the project folder/name from client to client-with-long-enough-name
excellent, I'll try that in a bit. Just now I made a copy of my "client" folder, named it "super-long-name-client", and removed all deps except clj and figwheel, that actually launched
With the same project.clj as above, got the following error on the require CompilerException java.io.FileNotFoundException: Could not locate ring/core/protocols__init.class or ring/core/protocols.clj on classpath., compiling:(ring/util/servlet.clj:1:1)
ok, added explicit dependency on ring-core "1.7.0", that seems to have made a difference
ok, 100% sure now that explicitly adding ring-core as a dependency made your REPL-statements work
The project with a "really-long-folder-name" now starts nicely with added ring-core 1.7.0 dep. The one with "shortname" does not.
Only the latest and greatest products are good enough for me and my windows computer 🙂
ok, got some distinct findings on the folder issue. Tried with the exact same project folder content, made copies with only folder name changed:
Folder name p01234567890123456789
:
clojure.lang.ExceptionInfo: Figwheel: Unable to dynamicly load figwheel.server.jetty-websocket/run-server {:not-loaded figwheel.server.jetty-websocket/run-server}
Folder name p012345678901234567890
(one character longer)
Works perfectly, launches figwheel with standard html page, reload works
Folder name p0123456789012345678901234567890123456789
java.lang.ClassNotFoundException: org.apache.commons.codec.binary.Base64, compiling:(ring/util/codec.clj:1:1)
Trying the folder C:\p0123456789012345678901234567890123456789
(same as last attempt, only on root)
clojure.lang.ExceptionInfo: Figwheel: Unable to dynamicly load figwheel.server.jetty-websocket/run-server {:not-loaded figwheel.server.jetty-websocket/run-server}
I'm on windows 10 with a very minimal project. Would you like an issue on this, @bhauman?
I'm beginning to think this is an issue with the total length of the classpath string on windows. The issue came back now when adding devcards as a dependency. Moved folder some levels closer to root, then it works
Made an issue https://github.com/bhauman/figwheel-main/issues/74 . Sorry for nagging about this, will fall back to regular figwheel now as I've not been able to get a stable build running.
@U21QNFC5C this is a windows command line path length problem https://github.com/technomancy/leiningen/issues/2452
Hello. I'm using the Sente library, and it doesn't have support for Jetty. How can I bypass the figwheel's default server, and use my own?
2018-09-10 18:25:19.151:WARN:oejs.HttpChannel:qtp1463775359-31: /figwheel-connect?fwprocess=4e3b7c&fwbuild=dev&fwsid=3e71f2ac-12b6-49ce-8cec-39110655da2a
java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.getServletContext()Ljavax/servlet/ServletContext;
the best way to run your own server is to start it with a -init or and -eval option with clj
ie put a start-server function in your user.clj file and add -e “(user/start-server)”
btw, from the documentation it isn't clear that the :pre-build-hooks are run every time
{:css-dirs ["resources/public/css"]
:watch-dirs ["src/cljs" "src/cljc"]
:open-url false}
whats important here is the url that figwheel is trying to connect to, and you can see that in the console
websocket.js:283 WebSocket connection to '' failed: Error during WebSocket handshake: Unexpected response code: 500
Then what I think is happening is that there is a simple jetty conflict in your dependencies
Really excited to try the new testing stuff with figwheel main! I'm starting with the flappy-bird-demo-new and adding a new namespace 'core-test.cljs' in the context of using lein so I'm wondering... where do I put my :auto-testing config option? should it go in the project map at [:cljsbuild :builds 0 :figwheel] ?
When I run fig:build I get the (reagent) app up at http://localhost:9500/ And should I be able to see the tests live updating at http://localhost:9500//figwheel-extra-main/auto-testing (b/c that doesn't work)?
extra credit: I'm really curious about the semantics of ;; specify reload hook with ^;after-load metadata quick scan of clojurescript and figwheel-main didn't highlight where that is used?