Fork me on GitHub
#conjure
<
2020-09-15
>
jkrasnay23:09:55

I just upgraded to 4.4.0 and I’m having trouble using Piggieback. It seems if I throw an exception in a CLJS session it prints the error but it ends up hanging nREPL somehow. Conjure stops evaluating anything for me. The only solution is to kill the REPL process.

jkrasnay23:09:50

Example:

; --------------------------------------------------------------------------------
; eval (current-form): (throw (ex-info "boom" {}))
; (err) #error {:message "boom", :data {}}
; --------------------------------------------------------------------------------
; eval (current-form): (throw (ex-info "boom" {}))
; --------------------------------------------------------------------------------
; eval (current-form): (throw (ex-info "boom" {}))
; --------------------------------------------------------------------------------
; eval (current-form): (throw (ex-info "boom" {}))

Olical11:09:24

Hmm nothing changed around here :thinking_face: if you roll back does it start working again?

Olical11:09:27

I'll try to repro it soon

jkrasnay18:09:33

I’ll try downgrading in a little bit

Olical20:09:35

So in shadow-cljs I see this

; --------------------------------------------------------------------------------
; eval (current-form): (throw (ex-info "boom" {}))
#error {:message "boom", :data {}}

Olical20:09:40

And everything continues to work

Olical20:09:09

; --------------------------------------------------------------------------------
; eval (current-form): (a-thing-that-doesnt-exist)
; (err) ------ WARNING - :undeclared-var -----------------------------------------------
; (err)  Resource: <eval>:1:2
; (err)  Use of undeclared Var dev.sandbox/a-thing-that-doesnt-exist
; (err) --------------------------------------------------------------------------------
; (err) 
nil
this when I get an exception

Olical20:09:51

And when I use piggieback + node repl

; --------------------------------------------------------------------------------
; eval (current-form): (throw (ex-info "boom" {}))
; (err) Execution error (ExceptionInfo) at (<cljs repl>:1).
; (err) boom
; (err) 
but the REPL still works

Olical20:09:07

So I think it's to do with your local REPL? But I can't be sure, of course.

jkrasnay00:09:56

Yeah, must be my local. I found I was behind on versions of nrepl, piggleback, and figwheel, but upgrading those didn’t help. I even disabled my error reporting to http://rollbar.com but still no joy.

jkrasnay00:09:16

Is it normal to see something like this in the browser console?

Olical08:09:12

:thinking_face: I don't think I saw it (got to work now so can't go into repro mode again just yet) Interesting that react devtools are in the stack there... what happens if you turn that off?

jkrasnay12:09:54

Doesn’t seem to make a difference. REPL still hangs on second exception.

Olical12:09:25

Okay, I'll try my best to repro this, I didn't actually try piggieback + figwheel so I'll give that a go later

Olical12:09:45

Might be a couple of days before I can investigate and either fix or let you know what the issue is though :thinking_face: I'll try!

jkrasnay13:09:15

Awesome, thanks! Let me know if there’s anything I can do to help.

jkrasnay23:09:10

I created a minimal reproducer. Unzip, lein repl, run figpig.server/start, hit http://localhost:6789 from your browser, then see instructions at the end of server.clj to repro the bug.

jkrasnay23:09:49

I get the same behaviour in both Chrome and FireFox on Macos

Olical08:09:46

Awesome, thanks a lot! I'll try to repro soon

Olical11:09:13

I can reproduce it with your example! Now to rule out Conjure...

Olical11:09:54

I think it's the figwheel setup and nothing to do with Conjure, it might be something you have to ask in #figwheel about. I've added a feature to develop though that means if your CLJS hangs you can still list sessions and kill them.

Olical11:09:35

Basically added a timeout feature to dead sessions so one dead session won't hold the rest to ransom (which froze Conjure effectively because Conjure likes to query the sessions)

Olical11:09:05

If I throw in a setTimeout it's okay, so figwheel on it's own / CLJS / the browser isn't having a problem

Olical11:09:15

Next step is to nREPL in from the CLI using some other nREPL client

Olical11:09:07

Reproduced entirely out of Conjure! In the lein repl prompt after hooking up figwheel any error causes figwheel to crash entirely.

Olical11:09:28

It's not Conjure I'm afraid 😞 it's something in figwheel but I don't know enough about it to know.

Olical11:09:39

It might not help but here's a working deps.edn version, could come in handy! https://gist.github.com/pyrmont/73d10c74d14f26772fd276c38ee3490d

jkrasnay13:09:10

Wow, great, that’s very helpful! Thanks again for your time.

jkrasnay23:09:38

Let me know if there’s anything I can do to help debug.