Fork me on GitHub
#re-frame
<
2023-06-03
>
Clark Urzo14:06:17

Trying to make re-frame-10x work with an existing app. I followed the guide and enabled code tracing in events, but for some reason whenever I use an fn-traced anywhere the dashboard closes as soon as the page loads. Here is what the browser console gives me:

[Error] NotFoundError: The object can not be found here.

	flushSyncCallbackQueueImpl (module$node_modules$react_dom$cjs$react_dom_development.js:163:210)
	flushSyncCallbackQueue (module$node_modules$react_dom$cjs$react_dom_development.js:162:270)
	scheduleUpdateOnFiber (module$node_modules$react_dom$cjs$react_dom_development.js:474:365)
	enqueueForceUpdate (module$node_modules$react_dom$cjs$react_dom_development.js:722:280)
	(anonymous function) (module$node_modules$react$cjs$react_development.js:48:84)
	day8$re_frame_10x$inlined_deps$reagent$v1v0v0$reagent$impl$batching$run_queue (day8.re_frame_10x.inlined_deps.reagent.v1v0v0.reagent.impl.batching.js:48)
	(anonymous function) (day8.re_frame_10x.inlined_deps.reagent.v1v0v0.reagent.impl.batching.js:207:86)
	(anonymous function) (day8.re_frame_10x.inlined_deps.reagent.v1v0v0.reagent.impl.batching.js:162)
	(anonymous function) (day8.re_frame_10x.inlined_deps.reagent.v1v0v0.reagent.impl.batching.js:172)
	G__40617 (day8.re_frame_10x.inlined_deps.reagent.v1v0v0.reagent.impl.batching.js:135)
...

Clark Urzo14:06:52

My shadow-cljs.edn:

:builds {:demo { :target           :browser
                 :output-dir       "public/js"
                 :asset-path       "/js"
                 :modules          {:main {:entries [<hidden>]}}
                 :devtools         {:http-root "public"
                                    :http-port 3000
                                    :preloads [day8.re-frame-10x.preload]}
                 :dev              {:compiler-options
                                    {:closure-defines
                                     {re-frame.trace.trace-enabled? true
                                      "re-frame.trace.trace-enabled_QMARK_" true
                                      day8.re-frame.tracing.trace-enabled? true
                                      "day8.re-frame.tracing.trace-enabled_QMARK_" true}}}
                 :release          {:build-options
                                    {:ns-aliases {day8.re-frame.tracing day8.re-frame.tracing-stubs}}}
                 :compiler-options {:infer-externs :auto
                                    :externs       ["datascript/externs.js"]}}}

Clark Urzo14:06:22

By the way, the ‘QMARK’ closure defines I only added (as per the rebux readme) just in case, but removing them does not solve the problem.

p-himik14:06:50

The QMARK stuff isn't necessary AFAIK because you have already added the same things as proper symbols. No clue about the error though - I can't even find that error in the sources of the libraries that I use, which include re-frame-10x.

Clark Urzo08:06:37

Huh, maybe it’s a version mismatch error. I’ll try permuting the libraries I’m using.

p-himik09:06:31

That would be stumbling in the dark. Instead, you can break on where that error is emitted and see what exactly is "the object" and how it could get to "here".

clojure-spin 2
Clark Urzo08:06:26

Sorry, I’m a bit of a novice still. What do you mean by ‘break’ here? Do I need to use something like Flowstorm?

p-himik08:06:16

Browsers have built-in debugger.

p-himik08:06:57

You can tell them to break at a specific line at all times or upon a condition being met, or when an exception is thrown, or when a particular DOM node is modified, or when a particular request is made, maybe other things.

p-himik08:06:19

Flowstorm might be useful but I haven't used it myself.

Clark Urzo08:06:57

I…what…I had no idea 😭 Okay, I’ll try banging my head against this again later