day8 / re-frame-debux

A fork of debux for tracing re-frame code (for eventual consumption by re-frame-10x)
Eclipse Public License 1.0
43 stars 7 forks source link

Adding re-frame-debux to project results in either Analysis Error or No such namespace issues #24

Closed ChrisHacker closed 4 years ago

ChrisHacker commented 6 years ago

I am trying to use re-frame-debux with re-frame-10x. I spent a couple of hours getting it set up and playing with it but can't get re-frame-debux to work.

I've checked the prereq's and versions - all good: clj 1.8 and cljs 1.9.946 I've got the dependencies set up with the two libs. tracing in :project/dev :dependencies and tracing-stubs in production :dependencies.

Here's what I added in :project/dev :cljsbuild :compiler

:preloads [day8.re-frame-10x.preload]
:closure-defines {"re_frame.trace.trace_enabled_QMARK_" true
                             "day8.re_frame.tracing.trace_enabled_QMARK_" true}

If I try to add [day8.re-frame.tracing :refer-macros [fn-traced defn-traced]] to my handlers.cljs file as :require and then use either of the macros, figwheel fails to compile with Could not Analyze ... Analysis Error targeted at the first use of either macro.

If I instead add [day8.re-frame.tracing :refer [fn-traced defn-traced]] to in :require-macros, figwheel will compile the code, but I get a bunch of warnings and the app throws errors when I try to load it in the browser. Line 39 is where the macro is invoked in the handlers.cljs file.

WARNING: Use of undeclared Var day8.re-frame.tracing/is-trace-enabled? at line 39 src/st/handlers.cljs
WARNING: No such namespace: debux.dbgn, could not locate debux/dbgn.cljs, debux/dbgn.cljc, or JavaScript source providing "debux.dbgn" at line 39 src/st/handlers.cljs
WARNING: Use of undeclared Var debux.dbgn/dbgn at line 39 src/st/handlers.cljs
Successfully compiled "target/cljsbuild/public/js/app.js" in 71.553 seconds.

Any idea what I'm doing wrong?

mike-thompson-day8 commented 4 years ago

I'm sorry to only now be addressing this very old issue. I don't know what the issue was.

To see re-frame-10x all wired up correctly, I'd suggest using re-frame-10x which will create a correct scaffold. Perhaps something like:

$ lein new re-frame <app-name> +10x 

Closing.