Open retrogradeorbit opened 7 years ago
I am having the exact same issue, can only do production builds with :optimizations set to :none
So I fixed this issue by moving the :require [cljsjs.material-ui] to the top of my core.cljs :require statement.
In my project, moving the :require [cljsjs.material-ui] to the top of my core.cljs did not help.
However, adding the following to :dependencies
did!
[cljsjs/react "15.6.2-4"]
[cljsjs/react-dom "15.6.2-4"]
commit for 15.6.2 seems to have added support for Global Exports but i dont know enough to understand if that's what helped.
Either way, it might be a good idea to update the readme to recommend 15.6.2-4
Whenever I include this project, and do an advanced compile, the compilation includes two copies of React and ReactDOM leading to this error in the console:
Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's render method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).
cleaning the deps tree of all other react and react-doms, then do an advanced compile (mine has :pretty-print true, :pseudo-names true), then look at the build artifact for react comment headers:
$ grep "^ [*] React" target/cljsbuild/public/js/app.js
And you can see there are two copies of both.
Has anyone else got this working on advanced compile, or is it something shitty about my project setup.
My deps at the moment are:
and
lein deps :tree
gives: