Web Development with Clojure, Third Edition: correct reference code (page 116)

In general, how do I correctly find the reference code that matches each book topic?

More specifically, I am having problems around page 116 testing that the code still works after setting up shadow-cljs. I tried using the reference code called “guestbook-shadow” and still had the same problems. Maybe I am using the wrong reference code. The problems I see are…

  • I don’t always see the “WebSocket connected!” in the browser. I have not figured out yet exactly when this happens.
  • GET /api/messages response is always 500 “Internal Server Error”
  • The page never gets passed “Loading Messages…”
  • Sometimes I get this error about invalid gy flags in xregexp.
  • I get some error about protocol_mask partition.
  • The browser console shows errors about formatters not being installed and another about custom formatters not being rendered.
  • On the positive side, the browser console reports App initilized and components mounted and shadow-cljs ready.

How do I debug this? A server-side unit test of get-messages responds with 200, so I think the problem is in middleware or the websocket config. I was hoping the reference code would help, but assuming I have the right one, it is the same, with exception of some SQL files.

I am enjoying the book very much & looking forward to getting past this hump. Thanks for your hard work.

Regards,
Pete

1 Like