Fork me on GitHub
#re-frame
<
2020-09-28
>
deadghost18:09:07

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.

lilactown19:09:26

#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)

deadghost19:09:08

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

lilactown19:09:33

Seems to be the important bit

lilactown19:09:46

What’s line 67 of registrar.cljc?

deadghost19:09:32

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.

lilactown19:09:27

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

🍺 3
lilactown19:09:08

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

👍 3
lilactown19:09:13

What version of re-frame are you using?