day8 / re-frame-10x

A debugging dashboard for re-frame. X-ray vision as tooling.
MIT License
634 stars 68 forks source link

mranderson047.reagent.v0v6v0.reagent.impl.util.react.createClass is not a function #132

Closed smee closed 6 years ago

smee commented 6 years ago

With [day8.re-frame/trace "0.1.15"] I see an error after cleaning and rebuilding my application:

component.cljs:267 Uncaught TypeError: mranderson047.reagent.v0v6v0.reagent.impl.util.react.createClass is not a function
    at mranderson047$reagent$v0v6v0$reagent$impl$component$create_class (component.cljs:267)
    at mranderson047$reagent$v0v6v0$reagent$impl$component$fn_to_class (component.cljs:306)
    at mranderson047$reagent$v0v6v0$reagent$impl$component$as_class (component.cljs:312)
    at mranderson047$reagent$v0v6v0$reagent$impl$template$reag_element (template.cljs:240)
    at mranderson047$reagent$v0v6v0$reagent$impl$template$vec_to_elem (template.cljs:312)
    at mranderson047$reagent$v0v6v0$reagent$impl$template$as_element (template.cljs:319)
    at f (dom.cljs:53)
    at mranderson047$reagent$v0v6v0$reagent$dom$render_comp (dom.cljs:30)
    at Function.mranderson047.reagent.v0v6v0.reagent.dom.render.cljs$core$IFn$_invoke$arity$3 (dom.cljs:54)
    at mranderson047$reagent$v0v6v0$reagent$dom$render (dom.cljs:41)

Maybe this version is not compatible with my other dependencies? 0.1.14 used to work with them. They are

[re-frame "0.10.3" :exclusions [reagent]]
[reagent "0.8.0-alpha2" :exclusions [[cljsjs/react] [cljsjs/react-dom]]]
[cljsjs/react-dom "16.2.0-3"]

Anything obvious I could try?

danielcompton commented 6 years ago

React 16 is the issue, I’ll get a release out shortly that works with React 16.

danielcompton commented 6 years ago

I tried reproducing this issue on todomvc, and I couldn't. Do you have a reproducible case I can look at?

smee commented 6 years ago

I think the problem is that the inlined reagent still assumes that react is available in version 15, see util.cljs#L7-L11 which references the global js/react variable. createClass was removed in version 16. I will try to recreate my local dependencies in TodoMVC.

smee commented 6 years ago

Okay, please see the adjusted dependencies in my fork at https://github.com/smee/re-frame/commit/b751a1d81169ab30a5d3e79b4abe01fcea405a50 I used the same set of dependencies and I see the same error in my console. The root call is day8$re_frame$trace$inject_devtools_BANG_ btw.

danielcompton commented 6 years ago

I've pushed a react-16 branch which has updated the Reagent dependencies. I've deployed a snapshot release: 0.1.16-20180126.084837-2. That should work, let me know if it doesn't.

I'll probably need to do parallel releases for a little while if it is not going to be possible to support both React versions with one bundled Reagent. That will probably look like doing two releases in parallel, one with a react-16 qualifier. I'm not 100% on that yet.

smee commented 6 years ago

Thanks a lot! Works great.

danielcompton commented 6 years ago

I've released 0.1.16-react16 as a parallel version to 0.1.16. See https://github.com/Day8/re-frame-trace#installation for more details.