conjure

:neovim:+:clj: https://github.com/Olical/conjure - If you're enjoying Conjure and want to say thanks: https://github.com/users/Olical/sponsorship :smile: (alt https://conjure.fun/discord)
2020-09-15T23:13:55.065300Z

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.

2020-09-15T23:14:50.065600Z

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" {}))

Olical 2020-09-16T11:33:24.066400Z

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

Olical 2020-09-16T11:33:27.066600Z

I'll try to repro it soon

2020-09-16T18:22:33.072500Z

I’ll try downgrading in a little bit

Olical 2020-09-16T20:33:35.072700Z

So in shadow-cljs I see this

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

Olical 2020-09-16T20:33:40.072900Z

And everything continues to work

Olical 2020-09-16T20:34:09.073100Z

; --------------------------------------------------------------------------------
; 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

Olical 2020-09-16T20:37:51.073300Z

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

Olical 2020-09-16T20:38:07.073500Z

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

2020-09-17T00:51:56.073800Z

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.

2020-09-17T00:53:16.074Z

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

Olical 2020-09-17T08:41:12.077300Z

: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?

2020-09-17T12:15:54.079100Z

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

Olical 2020-09-17T12:45:25.085400Z

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

Olical 2020-09-17T12:45:45.085600Z

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!

2020-09-17T13:09:15.087500Z

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

2020-09-17T23:46:10.000100Z

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.

2020-09-17T23:46:49.000500Z

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

Olical 2020-09-18T08:42:46.001Z

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

Olical 2020-09-19T11:22:13.006600Z

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

Olical 2020-09-19T11:22:54.006800Z

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.

Olical 2020-09-19T11:23:35.007Z

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)

Olical 2020-09-19T11:29:05.007200Z

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

Olical 2020-09-19T11:29:15.007400Z

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

Olical 2020-09-19T11:30:07.007600Z

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

Olical 2020-09-19T11:30:28.007800Z

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

Olical 2020-09-19T11:34:39.009300Z

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

2020-09-19T13:00:10.011800Z

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

2020-09-15T23:15:38.066Z

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