Fork me on GitHub
#shadow-cljs
<
2018-03-29
>
mitchelkuijpers08:03:39

@thheller

10:53:53.250 [XNIO-5 task-8] ERROR io.undertow.request - UT005071: Undertow request failed HttpServerExchange{ GET /release-snapshots/app/latest request {Accept=[text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8], Accept-Language=[nl-NL,nl;q=0.9,en-NL;q=0.8,en;q=0.7,en-US;q=0.6], Cache-Control=[max-age=0], Accept-Encoding=[gzip, deflate, br], User-Agent=[Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36], Connection=[keep-alive], Cookie=[_okbk=vi3%3Dinactive%2Ccd4%3Dtrue%2Cvi5%3D0%2Cvi4%3D1505836096585%2Cvi2%3Dfalse%2Cvi1%3Dfalse%2Ccd8%3Dchat%2Ccd6%3D0%2Ccd5%3Daway%2Ccd3%3Dfalse%2Ccd2%3D0%2Ccd1%3D0%2C; _ok=1700-237-10-3483; ring-session=1499777936043; _okdetect=%7B%22token%22%3A%2214837138200590%22%2C%22proto%22%3A%22http%3A%22%2C%22host%22%3A%22localhost%3A4040%22%7D; org.cups.sid=0ab9c463b9384ae47f668da6ac4cd702; olfsk=olfsk467559086084683; wcsid=bxjbgsCgQGydcOdD3m39N0N80JEr4BH2; _ga=GA1.1.1242069313.1495026997; hblid=BLdYcEe25b7HnC1K3m39NQDYCOR30OE6; _oklv=1505836580733%2CbxjbgsCgQGydcOdD3m39N0N80JEr4BH2], Upgrade-Insecure-Requests=[1], Host=[localhost:9630]} response {}} {  }
java.lang.RuntimeException: Map literal must contain an even number of forms
	at clojure.lang.Util.runtimeException(Util.java:221)
	at clojure.lang.EdnReader$MapReader.invoke(EdnReader.java:682)
	at clojure.lang.EdnReader.readDelimitedList(EdnReader.java:757)
	at clojure.lang.EdnReader$MapReader.invoke(EdnReader.java:680)
	at clojure.lang.EdnReader.readDelimitedList(EdnReader.java:757)
	at clojure.lang.EdnReader$VectorReader.invoke(EdnReader.java:672)
	at clojure.lang.EdnReader.readDelimitedList(EdnReader.java:757)
	at clojure.lang.EdnReader$MapReader.invoke(EdnReader.java:680)
	at clojure.lang.EdnReader.read(EdnReader.java:145)
	at clojure.lang.EdnReader.read(EdnReader.java:111)
	at clojure.lang.EdnReader.readString(EdnReader.java:67)
	at clojure.edn$read_string.invokeStatic(edn.clj:46)
	at clojure.edn$read_string.invokeStatic(edn.clj:37)
	at clojure.edn$read_string.invoke(edn.clj:37)
	at shadow.cljs.devtools.server.web.release_snapshots$info_page.invokeStatic(release_snapshots.clj:41)
	at shadow.cljs.devtools.server.web.release_snapshots$info_page.invoke(release_snapshots.clj:33)
	at clojure.lang.AFn.applyToHelper(AFn.java:160)
	at clojure.lang.AFn.applyTo(AFn.java:144)
	at clojure.core$apply.invokeStatic(core.clj:659)
	at clojure.core$apply.invoke(core.clj:652)
	at shadow.http.router$call_handler.invokeStatic(router.clj:12)
	at shadow.http.router$call_handler.invoke(router.clj:11)
	at shadow.cljs.devtools.server.web.release_snapshots$root.invokeStatic(release_snapshots.clj:55)
	at shadow.cljs.devtools.server.web.release_snapshots$root.invoke(release_snapshots.clj:54)
	at clojure.lang.AFn.applyToHelper(AFn.java:154)
	at clojure.lang.AFn.applyTo(AFn.java:144)
	at clojure.core$apply.invokeStatic(core.clj:659)
	at clojure.core$apply.invoke(core.clj:652)
	at shadow.http.router$call_handler.invokeStatic(router.clj:12)
	at shadow.http.router$call_handler.invoke(router.clj:11)
	at shadow.cljs.devtools.server.web$root.invokeStatic(web.clj:160)
	at shadow.cljs.devtools.server.web$root.invoke(web.clj:159)
	at shadow.cljs.devtools.server$get_ring_handler$fn__56432.invoke(server.clj:60)
	at ring.middleware.resource$wrap_resource$fn__14079.invoke(resource.clj:37)
	at ring.middleware.resource$wrap_resource$fn__14079.invoke(resource.clj:37)
	at ring.middleware.params$wrap_params$fn__14063.invoke(params.clj:67)
	at shadow.cljs.devtools.server.ring_gzip$wrap_gzip$fn__56057.invoke(ring_gzip.clj:94)
	at shadow.undertow$ring_STAR_$reify__56143.handleRequest(undertow.clj:27)

thheller08:03:41

what the heck?

thheller08:03:54

oh wait ... probably cider right?

mitchelkuijpers08:03:20

Oh no this is after: (shadow.cljs.devtools.api/release-snapshot :app {})

thheller08:03:28

but called via cider?

thheller08:03:50

cider sets *print-length*

mitchelkuijpers08:03:32

Sorry for the noise 😛

thheller08:03:34

.shadow-cljs/release-snapshots/app/latest/bundle-info.edn probably contains elided forms

thheller08:03:57

I'll create a "safe" print fn that sets all the print vars back to something good

thheller08:03:38

for now try (binding [*print-length* 0] (shadow.cljs.devtools.api/release-snapshot :app {}))

mitchelkuijpers09:03:26

that also breaks it right? print-length 0

thheller09:03:52

is it nil by default? though 0 was print everything

mitchelkuijpers09:03:02

Ah that might be the case

mitchelkuijpers09:03:06

I made it 999999999 😛

thheller09:03:21

If it is bound to logical false, there is no limit.

thheller09:03:25

so false/nil works

danielo51516:03:55

Hello everybody

danielo51516:03:33

I want to thank shadow-cljs developers a big thank for the easiest cljs tool to use

danielo51516:03:24

I think the only downside the tool has is it's website,it seems to be focused on browser environments or browser targeted apps, while this is not true. I was looking for building some node-cljs scripts and I first discarded shadow-cljs for this regard

thheller16:03:58

@rdanielo welcome. yeah the docs are a constant work in progress. can't document everything at once since it does so much.

danielo51516:03:45

I can understand that. To be honest, docs are very good. The only thing I'm missing is a simple but clear statement saying: you can use this tool with node-js as target, here is the example project: link

danielo51516:03:09

Because everything is already in place: node-js target documentation, node-js project examples, but there is no mention on the main readme

jmckitrick16:03:00

When using re-frame-10x, I’m supposed to add a line to :closure-defines. What is the equivalent for shadow?

thheller16:03:36

@jmckitrick :closure-defines {re-frame.trace/trace-enabled? true} in your build config

thheller16:03:42

I think that was it

jmckitrick16:03:45

Oh, same thing? ok

thheller16:03:57

probably best to set it in :dev mode only

danielo51516:03:14

@thheller are you the author of shadow-cljs ?

thheller16:03:14

:dev {:closure-defines {re-frame.trace/trace-enabled? true}}

danielo51516:03:37

I want to thank you for thinking out of the box and making a non strictly js tool available through npm

danielo51516:03:47

I think npm it is an impressive distribution system

danielo51516:03:16

and I used it to deploy all kind of stuff, including interactive documentation and general scripts, glad to see that a JVM based tool get into it too

thheller16:03:13

wasn't my idea. copied it from https://github.com/cljs/tool but it makes total sense in a CLJS setting

danielo51517:03:12

Absolutely, it was the most straighforward installation I experienced in the cljs world

☝️ 4
danielo51517:03:44

One simple question

danielo51517:03:58

How can I reload a file on the REPL once it has been re-built ?

danielo51517:03:06

I am targeting node repl

thheller17:03:30

should be (require 'that.ns :reload)

thheller17:03:50

but thinking about it I may have actually broken that recently 😛

thheller17:03:38

oops yes its broken.

thheller17:03:49

:reload is ignored, will fix

hlolli17:03:39

I think dnolen talked about some bug with :reload or :reload-all, either or, or both (in clojurescript environment)

thheller17:03:28

no thats just me. not using the related CLJS code so if there is a bug in that as well its purely coincidental

danielo51519:03:34

So reload-all does not work neither ?

danielo51519:03:56

One question, after a couple of iterations the REPL become slow and arrow keys are not working, so I can not take advantage of history

danielo51519:03:10

Anyone knows a reason ?

danielo51519:03:05

Mmm, seems to be a problem with VSCode integrated terminals

danielo51519:03:11

What a pitty

danielo51519:03:19

Which editor do you use, which is not emacs

justinlee19:03:39

for clojurescript, cursive is the only realistic choice.

justinlee19:03:57

i would prefer to use atom, but protorepl isn’t that great for it yet

thheller19:03:26

@rdanielo :reload is fixed in 2.2.21

danielo51519:03:48

Awesome. Can I reload all the already loaded files ?

thheller19:03:38

(require 'the.thing :reload)

danielo51519:03:12

But that will only require that file

danielo51519:03:19

I want to reload the entire project

thheller19:03:50

oops forgot about :reload-all

danielo51520:03:05

Does that mean that it works ?

thheller20:03:13

no :reload-all doesn't work. will fix.

thheller19:03:10

rlwrap makes things more usable if you are on linux/mac

danielo51519:03:24

What is so cool about rlwrap ? Seems to be used on many cljs and haskell projects

thheller19:03:09

provides readline capabilities. eg. up/down arrow support

danielo51519:03:36

@lee.justin.m does cursive require an intellij license ?

thheller19:03:39

I did not have time to write the code for that yet myself but rlwrap just works

thheller19:03:56

you can use IntelliJ Community Edition which is free

danielo51519:03:42

Is this the proper way to declare deps on shadow ? :dependencies [:binaryage/oops "0.5.8"]

thheller19:03:54

no :dependencies [[binaryage/oops "0.5.8"]]

thheller19:03:59

same as lein or boot

danielo51519:03:05

Ahh, that's the point

danielo51519:03:20

Thanks @thheller, deps works now

danielo51519:03:43

Has anyone being able to connect lighttable to a shadow repl ?

danielo51520:03:28

shadow-cljs - server running at 
shadow-cljs - socket repl running at localhost:49898
shadow-cljs - nREPL server started on port 49900
Damn, how many sockets does this open ?

danielo51520:03:29

Should I use the nREPL one for ide integrations ?

thheller20:03:59

no idea which kind of REPL lighttable supports

danielo51520:03:41

it has an option to connect to a remote clojure REPL through nREPL

danielo51520:03:49

So I guess the third one is the correct option

danielo51520:03:03

Does this error Worker shutdown. mean that I have to restart the server process ?

thheller20:03:43

no it means that the watch was stopped

danielo51520:03:15

REPL became non-responsive

thheller20:03:21

how are you using things?

thheller20:03:36

shadow-cljs node-repl?

danielo51520:03:12

I had to reload the repl, force stop and then start it again

danielo51520:03:39

Can this be related with js interop ? ` [{:type clojure.lang.ExceptionInfo :message "failed to parse ns require"` I'm using the latest version

thheller20:03:44

then just running shadow-cljs node-repl again should work fine

thheller20:03:00

ns form is invalid

thheller20:03:23

or rather the require I should say

thheller20:03:36

what are you trying?

danielo51520:03:48

(ns rancher-cli.core
  (:require 
    [cljs.nodejs :as nodejs]
    [rancher-cli.request :as req]))

danielo51520:03:01

(ns rancher-cli.request
  (:require [cljs.nodejs :as nodejs]
            [request :as req]))

danielo51520:03:21

and I ust did (require 'rancher-cli.core) on the repl

danielo51520:03:27

but before I tried

danielo51520:03:37

(in-ns 'rancher-cli.core)

thheller20:03:47

in-ns only works after require

thheller20:03:56

but the require failed?

thheller20:03:09

[{:type clojure.lang.ExceptionInfo :message "failed to parse ns require"

thheller20:03:12

when did you get this?

danielo51520:03:06

I got that making a require after making the in-ns first

danielo51520:03:17

So maybe I screw things up with that

hlolli20:03:56

what is [request :as req], probably an error?

hlolli20:03:36

if you are in light-table and you evaluate the whole file with ctrl+enter, you are effectively doing the same thing as require-ing a file

danielo51520:03:45

Nope, it's an npm library

geraldodev20:03:11

Hi, do you have project to suggest as a starting point for developing with shadow-cljs ?

hlolli20:03:12

ah ok, npm library has special syntax in clojurescript, you would need quotation marks ""

danielo51520:03:01

It was working before without quotation marks

danielo51520:03:27

@hlolli are you using lightabe? How do you connect it to the repl?

hlolli20:03:46

so (ns my.ns (:require ["request" :as req]))

hlolli20:03:20

if that worked, it probably never got evaluated, except you have a cljs file called request lurking in your root directory

danielo51520:03:05

Does that mean that it works ?

danielo51520:03:38

I have a file called request on my directory, and it's there where I do the request

hlolli20:03:29

yes but that file is on classpath

danielo51520:03:41

Rebooting the server and the repl worked

danielo51520:03:49

It is now working with your syntax

danielo51520:03:58

But I think it would work too without quotes

danielo51520:03:18

I did not find any reference to what you are saying, I mean about using quotes

danielo51520:03:19

Oops, new error appeared, hahaha

[1:1]~rancher-cli.core=> (require 'rancher-cli.core :reload)
[:result {:type :repl/error, :ex #error {
 :cause "Circular dependency detected: rancher-cli.core -> rancher-cli.core"
 :data {:tag :shadow.build.resolve/circular-dependency, :resource-id [:shadow.build.classpath/resource "rancher_cli/core.cljs"], :path [rancher-cli.core rancher-cli.core], :stack [[:shadow.build.classpath/resource "rancher_cli/core.cljs"]]}
I'm pretty sure I don't have circular deps, well, I had loaded that namespace with in-ns so maybe that was the problem

hlolli20:03:29

Are you requireing re-frame in a node repl?

danielo51520:03:49

@geraldodev which kind of project are you interested at ? node ? browser ?

danielo51520:03:16

@hlolli are you talking to @mynomoto right ?

thheller20:03:50

@mynomoto it appears zprint.main has (:gen-class) in its ns. this means it can't be loaded as CLJS. don't worry about it though unless you were actually planning on using that.

thheller20:03:03

I should make the error for this less noisy I guess

hlolli20:03:56

no I was talking to you @rdanielo, all these default slack profile pics are confuseing me who is who 🙂 I'm also bit burnt out after this week.

mynomoto21:03:19

@thheller thanks, I'm not using it! I have problems ignoring stacktraces but will do my best 😉

danielo51521:03:27

Yes, I agree, I'll update my avatar

danielo51521:03:22

@hlolli no, I am not using re-frame. My error about the circular dependency solved by moving to a different namespace, making the require from there and then moving to the original namespace again

danielo51521:03:42

Sorry to hear that you're burned out

mynomoto21:03:14

[:browser] Build failure:
The required namespace "cljsjs.react-highlight" is not available, it was required by "day8/re_frame_10x/view/components.cljs".
This one seems to be a real error.

thheller21:03:47

that would be lovely

mynomoto21:03:39

Great, will do. I'm kind of regreting the packages that I added on cljsjs now :thinking_face:

mynomoto21:03:51

Is there a table somewhere of how the js thing is exported and how to require it from cljs?

mynomoto21:03:44

@lee.justin.m that's the one, thanks! My search abilities are failing right now...

mynomoto21:03:40

So in the rabbit hole of highlight, how do I create a cljsjs shim for https://github.com/isagalaev/highlight.js/blob/master/src/languages/clojure.js ?

mynomoto22:03:40

I think I solved the above problem but got a new one:

The required namespace "mranderson047.reagent.v0v8v0_alpha2.reagent.core" is not available, it was required by "day8/re_frame_10x/view/event.cljs".
"mranderson047/reagent/v0v8v0_alpha2/reagent/core.clj" was found on the classpath. Should this be a .cljs file?
There is a clj and a cljs file with the same name.

mynomoto22:03:01

I'm going to be away for a while.