ring

manas_marthi 2025-04-08T18:28:28.591839Z

Hi, On day 3 of a new clj-kit app. All of a sudden, wrap-reload and wrap-refresh stopped working. What possibly can go wrong. Is there a way to enable any tracing or error logging.

manas_marthi 2025-04-08T18:39:53.178289Z

I see a message Stopping existing deps.Edn watchers I don’t think I saw this earlier

2025-04-08T18:43:59.783389Z

see a message where? neither wrap-reload or wrap-refresh doing anything with deps.edn. Seems suspicious that it says deps.Edn and not deps.edn

manas_marthi 2025-04-08T18:45:12.609569Z

Iphone auto corrected the e to E

manas_marthi 2025-04-08T18:45:27.405489Z

The message is in the repl window

2025-04-08T18:49:01.321879Z

I would double check if reloading is actually happening, but you just are not seeing updated behaviors (if you put a println at the top of the file does the printing happen when reloading should occur)

2025-04-08T18:50:23.044189Z

if that is the case likely you are capturing a function value in your route definition somewhere instead of keeping a mutable reference that can be updated (exactly how this happens and what to do about it will depend on how you are doing routing)

2025-04-08T18:52:13.128329Z

https://cljdoc.org/d/metosin/reitit/0.5.18/doc/advanced/dev-workflow?q=reload#an-example has some discussion of that kind of thing for reitit

manas_marthi 2025-04-09T02:04:03.199729Z

Thank you. The dev workflow setup you mentioned is already there in my code as it is part of clj-kit template code. I had to change ["/" {:get home}] to ["/" {:get #(home %)}]`` to see changes made to value of :a in home handler function below. I still can't get wrap-refresh to work though

manas_marthi 2025-04-09T02:04:14.902459Z

(defn home [request]
  (layout/render request "home.html" {:a 9}))

;; Routes
(defn page-routes [_opts]
  [["/" {:get #(home %) }]])

manas_marthi 2025-04-09T02:06:04.128539Z

The dev workflow setup you mentioned is already there in my code as it is part of clj-kit template code.

manas_marthi 2025-04-09T02:08:53.749919Z

My code is based on https://github.com/clojurestream/kit-workshop?tab=readme-ov-file#routing