This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # admin-announcements (4)
- # beginners (21)
- # boot (85)
- # cider (31)
- # clojure (45)
- # clojure-australia (1)
- # clojure-berlin (2)
- # clojure-dev (7)
- # clojure-italy (10)
- # clojure-japan (17)
- # clojure-norway (8)
- # clojure-russia (2)
- # clojure-uk (15)
- # clojurebridge (1)
- # clojurescript (115)
- # code-reviews (13)
- # core-async (1)
- # editors (17)
- # euroclojure (5)
- # jobs (1)
- # ldnclj (9)
- # off-topic (5)
- # om (18)
- # re-frame (15)
- # reagent (25)
- # sydney (1)
In porting a figwheel cljs app to use boot, I am getting a long stream of these errors when I run
2015-07-10 11:51 java (CarbonCore.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-21)
Having a hard time with Boot. It's complaining when I run
So I have placed an env.clj and env.cljs in my ~/src/cljs folder - didn't help. Then I searched for all references to env in my project and commented out offending code to see if I can get rid of the error, but still no luck.
clojure.lang.Compiler$CompilerException: java.io.FileNotFoundException: Could not locate cljs/env__init.class or cljs/env.clj on classpath: , compiling:(cemerick/piggieback.clj:1:1) java.io.FileNotFoundException: Could not locate cljs/env__init.class or cljs/env.clj on classpath: ...
Let me check. I think the
register_with_server error was caused by memory issues (I was running a lot of boot watchers)
can check with
boot -V, and can pin it with
BOOT_CLOJURE_VERSION=1.7.0 boot -V > boot.properties
I have tried: - putting main.cljs.edn in resources/public, src/cljs/resources/public, neither worked. Also tried passing the output-dir and output-to to compiler-options but that didn’t work. The closest I have come is for the compiled js to be in target/resources/public :wink:
boot as a system, rather than boot-cljs as a task (which handles the cljs.edn files), handles writing outputs from the fileset back to the project directory
there are some fileset sync functions to use in your own task if you want separate js / jar target paths i guess (haven’t used them)
@crisptrutski: - ah I see - thanks. I don’t see how to construct my build.boot so only JS goes into resources/public - I guess that is the fileset sync functions you mentioned….
There shouldn't be a reason to have boot write the files to resources folder (instead of target folder)
I'm guessing you are trying to do this because you are serving static files from resources/public folder?
so cljs->js ends up in target but I have a compojure route serving the target/js/main.js?
pretty much only time you should do anything with files in target/ is when you copy the .jar file from there
if you put cljs.edn in e.g. src/cljs/public/main.cljs.edn the compiled file should be in path "public/main.js", and you don't really need to care what the filepath is, because boot-cljs will add the resulting files to classpath so they are accessible using e.g. (io/resource "public/main.js")
Check this project: https://github.com/Deraen/saapas/blob/master/src/clj/saapas/server.clj#L13-L14
is the resources path “dynamic” - ie if a separate process update the js in
/target, will an existing ring server start serving the new content?
@crisptrutski: Nothing is updating anything in /target, they are updating stuff in fileset (theye
ok, so for arguments sake - if a server was being run with lein ring, and cljs was being compiled with boot (eg. an app busy migrating)
thanks both - @juhoteperi I will have a look at that snippet. I don’t get how boot and ring are communicating so I need to do some more reading I think. Specifically how uberjar works in this context etc.
@crisptrutski: I'm not sure what would be proper way do that, the right way is to run both ring and cljs in boot (same process, same classpath)
@juhoteperi - let me repeat - thanks, really, this project is exactly what I needed - thanks for your efforts
Boot core concept pages in boot wiki are good read, especially the fileset article should be very useful even when not writing boot tasks
thanks from me also - was just trying to understand jvm resource paths more, not question the wisdom :simple_smile:
Yeah it takes some time to get used to, I also used to serve files from filesystem instead of classpath when using Lein
Though nowadays I use classpath with Lein too, takes just a bit more magical configuration there but makes the code simpler
@juhoteperi, I was just starting to respect you but then I noticed vim - really! (Oh, I didn’t just go there! :))
om/reagent, vim/emacs, cursive/counterclockwise - too many religious wars to fight :wink:
some cool tricks in this repo - the way you put the system + boot stuff together, and the “.no-reload” idea are new to me
I really appreciate these types of projects which tie these things together. Very helpful
With Component it would probably be useful to use reloaded-repl, I might update Saapas to show that
hey @martinklepsch - you back in fernsentrum land now? (ps do those stickers even ship :simple_smile:)
getting weird behaviour - application is running and loading the latest JS (thanks @juhoteperi), however not all CLJS changes are being pushed. For example, I have a ‘run-render’ fn which (js/console.log) and then (reagent/render). If I change that js/console.log I see the new text appear - great, however if I change any of the reagent component fns I see the run-render being executed (with the updated js/console.log) but not the updated reagent...
this all used to work in lein figwheel so I don’t think I have any muppet mistakes (but open to the notion that I have)
@colin.yates: I'm wondering if you are suffering a version of this: https://github.com/reagent-project/reagent/issues/153#issuecomment-118449228
@mikethompson: Thanks Mike, however when I used figwheel it was all working, I am sure I have muffed something in boot. I will check that issue more thoroughly though
Hello, Newbie here. I'm trying to create a node cljs project and use boot. Any recommendations on declaring npm dependencies in boot?
one thing i can recommend is to look for a lein plugin that does it (i think there is one)
you can use the functions underneath the plugin from your boot task pretty easily usually
just load the dependency via
set-env! in the repl, require the namespace, and play around
ok. Thanks. It may turn out that I don't need it because I can just specify them in node package.json. I might look into the lein approach though. Thanks very much for your help!