Fork me on GitHub
#boot
<
2016-12-22
>
kenny01:12:59

Hmm.. I updated to boot 2.7.0 and my reload function doesn't seem to be getting ran with updated code. I have :on-jsload set to a def which looks like this

(def reload-fn my-ns/main)
where my-ns/main is defined as:
(defn main
  []
  (enable-console-print!)
  (println "ran"))
If I change the string that gets print out to "ran2" and save the file, then my boot task will compile the files and reload in the browser. The problem is ran gets printed out, not ran2.

kenny01:12:30

If I set :on-jsload to be my-ns/main instead of the above def'ed reload-fn, then the correct result is printed out when changed.

kenny01:12:18

And just to be clear, reload-fn is in a different namespace than main.

grounded_sage07:12:02

I'm having trouble rendering special characters. I'm not sure what is going on I've tried unicode characters but apparently they don't seem to work in chrome? I'm completely stumped.

Compiling ClojureScript...
• js/app.js
         clojure.lang.ExceptionInfo: No group 1
    data: {:file
           "/var/folders/yq/n5bg23w14_73jpfnb1zvn0vw0000gn/T/boot.user6497735034777314577.clj",
           :line 21}
java.lang.IndexOutOfBoundsException: No group 1

grounded_sage07:12:46

I'm simply doing this [:span "$"]

pesterhazy08:12:50

@grounded_sage that's not enough context to find out what's going on

grounded_sage08:12:33

This is the repo. I have just uploaded it with the error occuring. Inside of web.clj I am trying to list some prices. But it keeps throwing an error everytime I use special characters. https://github.com/CommonCreative/vbn-redesign

grounded_sage08:12:18

I have no idea how to give any more context as I don't know what context would be relevant @pesterhazy

pesterhazy08:12:52

@grounded_sage perhaps a rum bug?

grounded_sage08:12:12

That was what I was thinking.

grounded_sage08:12:56

It's frustrating because Uni codes also don't appear to work in chrome at all. So I'm going to have to use an SVG to represent a dollar sign 😕

alexyakushev11:12:20

Hey, I just spent an hour debugging WTH my script has suddenly stopped working

alandipert15:12:49

@micha wondering ⬆️ why we don't just concatenate boot/profile files string-wise instead of reading and then concat-ing

micha15:12:41

@alandipert interesting, yeah we probably could?

micha16:12:07

@alandipert also maybe we should use clojure.core/load-string instead of clojure.core/load-file there?

micha16:12:14

so we don't need to write the temp file

micha16:12:28

not sure if that works the same way though

alandipert16:12:57

i think that would work

alandipert16:12:30

@jumblerg btw i noticed that clojure-adapter-servlet's java codes are built against java 1.8

alandipert16:12:04

how would you feel if i built a release against 1.7 so that it worrked everywhere boot did?

jumblerg16:12:22

@alandipert: makes sense to me.

richiardiandrea17:12:20

The upside-down stack trace is awesome

arohner21:12:12

hi, I’m trying to serve cljs compiled with boot-cljs. Chrome is complaining with “net::ERR CONTENT LENGTH MISMATCH”. I noticed:

arohner21:12:27

boot.user> (.getContentLength (.openConnection (io/resource "public/js/client.js")))
2240028
boot.user> (count (slurp (io/resource "public/js/client.js")))
2239970

arohner21:12:29

so far, I’ve only found the lengths to differ on compiled cljs files. other files in my resources/public folder are fine

arohner21:12:44

I have no clue how ^^ is possible

arohner21:12:52

hrm, probably text encoding issue

arohner21:12:14

boot.user> (count (slurp (io/resource "public/js/record_client.js") :encoding "UTF-8")) 2239970 boot.user> (count (slurp (io/resource "public/js/record_client.js") :encoding "ISO-8859-1")) 2240028

alandipert21:12:19

what are you using to serve?

alandipert21:12:32

i haven't seen that error before, guessing chrome is getting content-length header but body size doesn't agree?

arohner21:12:38

ring, then proxied over nginx

alandipert21:12:12

tried w/out nginx in middle?

arohner21:12:49

the repl commands make me think it’s a clojure issue, because I can repro differing lengths by setting :encoding

arohner21:12:09

clojure = my app

alandipert21:12:25

maybe try setting encoding header explicitly in ring handler? maybe its emitting something that nginx is interpreting incorrectly?

alandipert21:12:53

i guess eliminating nginx would let you narrow it to jvm

alandipert21:12:44

(System/getProperty "file.encoding") stackoverflow says this iis maybe a thing to check

richiardiandrea22:12:12

question, can an exception pass pod boundaries?

arohner23:12:55

I think there’s something I don’t understand re: content-length and file encoding. JVM file encoding is utf-8, Charset.defaultCharset is utf-8, but ring reports content-length= number of bytes in the file, rather than number of utf-8 chars in the file. But if put gzip infront of the request, the content-length gets overwritten, and everything works. ¯\(ツ)

arohner23:12:13

@richiardiandrea I’ve only read about pods, not used them directly, but my guess is no

richiardiandrea23:12:33

I guess I need to try 😉

richiardiandrea23:12:02

and surprisingly they do 😉