You can find the reference code here under the “Resources” section.
The “WebSocket Connected” message not appearing is likely due to shadow-cljs being inactive or still compiling. You can try getting more info from the browser console, or check the CLI output for a message that looks like [:app] Build Completed. (...)
The 500 from /api/messages
could be plenty of things. Validating the get-messages
function is a good start, that means it’s likely an issue with the route itself. Check the logs for an error, and if that’s not descriptive, add a log statement at the very beginning of your handler fn to make sure you enter it. If not, it’s likely an issue with the :parameters
or :responses
validation, but it could be another route issue. If you do get the log statement, wrap the handler body in a try/catch and log the error before re-throwing to get more info. Sometimes the error can get obfuscated by the middleware stack.
The page never getting past “loading messages…” is a result of the 500 most likely, since they’re failing to load.
The gy flags in xregexp is a version issue. Try bumping the version and removing core-js
dependency.
I am not sure what the protocol_mask partition issue is, so that would need some further investigation. Sorry I can’t be helpful there. Try seeking out help from shadow-cljs documentation or open an issue on the shadow-cljs
github repository if you can’t resolve it. https://github.com/thheller/shadow-cljs
The formatters sounds like an issue with cljs-devtools chrome plugin. It shouldn’t be an issue with the application itself.
Good luck with the debugging. Share your logs and relevant code if you’re still stuck.
Glad to hear you’re enjoying the book so far, thanks for reading!