re-frame

https://github.com/Day8/re-frame/blob/master/docs/README.md https://github.com/Day8/re-frame/blob/master/docs/External-Resources.md
deadghost 2020-09-28T18:11:07.007200Z

project.unit.foo=> (rf/reg-sub :test (fn [db _] :hello))
#object[TypeError TypeError: Cannot read property 'call' of undefined]
	 (<NO_SOURCE_FILE>)
	 re-frame.registrar/register-handler (resources/public/js/compiled-test-nodejs/out/re_frame/registrar.cljc:67:3)
	 Function.re_frame.subs.reg_sub.cljs$core$IFn$_invoke$arity$variadic (resources/public/js/compiled-test-nodejs/out/re_frame/subs.cljc:183:6)
	 Function.f (resources/public/js/compiled-test-nodejs/out/re_frame/subs.cljc:149:1)
	 (resources/public/js/compiled-test-nodejs/out/cljs/core.cljs:3895:30)
	 (resources/public/js/compiled-test-nodejs/out/cljs/core.cljs:3887:1)
	 Function.re_frame.core.reg_sub.cljs$core$IFn$_invoke$arity$variadic (resources/public/js/compiled-test-nodejs/out/re_frame/core.cljc:189:4)
	 re_frame$core$reg_sub (resources/public/js/compiled-test-nodejs/out/re_frame/core.cljc:58:1)
Any idea why figwheel-main + lein + nodejs + re-frame doesn't want to cooperate with me? I can't say I understand what the stacktrace is trying to tell me.

lilactown 2020-09-28T19:23:26.007400Z

#object[TypeError TypeError: Cannot read property 'call' of undefined]
	 (<NO_SOURCE_FILE>)
	 re-frame.registrar/register-handler (resources/public/js/compiled-test-nodejs/out/re_frame/registrar.cljc:67:3)

lilactown 2020-09-28T19:23:33.007700Z

Seems to be the important bit

lilactown 2020-09-28T19:23:46.008200Z

What’s line 67 of registrar.cljc?

lilactown 2020-09-28T19:25:13.008600Z

What version of re-frame are you using?

deadghost 2020-09-28T19:41:08.008700Z

1.0.0-rc2

(defn register-handler
  [kind id handler-fn]
  (when debug-enabled?                                       ;; This is in a separate when so Closure DCE can run
    (when (and (not (settings/loaded?)) (get-handler kind id false))
      (console :warn "re-frame: overwriting" (str kind) "handler for:" id)))   ;; allow it, but warn. Happens on figwheel reloads.
  (swap! kind->id->handler assoc-in [kind id] handler-fn)
  handler-fn)    ;; note: returns the just registered handler

deadghost 2020-09-28T19:52:32.009200Z

Bumped re-frame to 1.1.1 and that did it! 👏 Thank you. I was stuck on this for days. How did you go from registrar.cljc to suspecting the re-frame version? Seems like a big leap.

lilactown 2020-09-28T19:53:27.010Z

I looked at the code on GitHub and there’s no line 67 in the latest lol

🍺 1
lilactown 2020-09-28T19:54:08.011200Z

Didn’t know what was wrong but figured we would need to see what changed to figure it out. Glad upgrading just worked

👍 1