Hey, I'm not sure if this stack trace is sufficient info. Any ideas on how to fix this error?
TypeError: Cannot read property '__reactAutoBindPairs' of undefined at reagent1 (cljs_base.js:formatted:560) at cS (cljs_base.js:formatted:24647) at sU (cljs_base.js:formatted:27645) at mU (cljs_base.js:formatted:27157) at dU (cljs_base.js:formatted:26925) at rR (cljs_base.js:formatted:26709) at vU (cljs_base.js:formatted:28133) at cljs_base.js:formatted:28202 at qU (cljs_base.js:formatted:26965) at AU (cljs_base.js:formatted:28201)
I have run
lein cljsbuild once min to generate js files and I'm trying to attach these files via script tags to a HTML page.
this error looks like it is coming from an
:advanced compilation artifact. you might be able to get more info with the compiler flag
:pseudo-names true as per https://clojurescript.org/reference/compiler-options#pseudo-names. you probably know this already but you can get a working reagent project up and running quite quickly with
lein new reagent-frontend myproject and then run
lein figwheel inside
myproject to launch it and
lein package to build the static version you can deploy.
I am currently working on a CLJS project. The project uses OM and it breaks my heart to say that the app is essentially one really long file. Everything is tightly coupled. The team and I want to move away from OM and transition to Reagent/Re-frame. I gave it a shot but it doesn't look like it possible (or straight forward) since adding reagent/re-frame seemed have to cause some react issues. (Errors complaining that some things were undefined such as
isValidContainer). I was wondering if it was possible to use Om with Re-frame? I'd like to be able to at least off-load state handling to a more centralized state-management system like reframe. Anyone know if this is possible? More specifically if I can use re-frame's subscribe method to trigger updates in much the same way it would with reagent components.
I'm not sure if it's possible to have reagent components inter-operate with om components. I also think the way a reagent/re-frame app is written presents an entirely different paradigm/way of building web apps.
IMO, I think it's wise to just rewrite the whole app in reagent/re-frame instead of trying to refactor some pieces of the already existing one.
@franklineapiyo Thank you! Yea my goal was to have OM components be as dumb as possible and only render the view. While the state management is handled by re-frame. I was thinking of "tricking" the om component by wrapping the
subscribe to a OM cursor. That way if that updates then the Om's cursor update, triggering an update. I haven't tested that out yet. But it may be the case that we are too far down the rabbit hole that its not possible to do a whole rewrite. At least not with our man power