Hi,
my app works fine in dev and up until now worked fine in production.
Now I get:
FATAL [com.fulcrologic.fulcro.components:400] - Cannot find app on component!
when I swap out main.js
form the shadow-cljs dev build with main.js
from shadows-cljs release.
Does anyone have any tips where to look.
The app starts up fine but some event triggers this:
react_devtools_backend.js:2430 TypeError: Cannot read property 'cljs$core$IFn$_invoke$arity$1' of null
at net.markusgraf.hhh.ui.person_list.ListDeployment.component_did_mount [as componentDidMount] (main.js:8514)
at Nj (main.js:164)
at ak (main.js:197)
at m.unstable_runWithPriority (main.js:26)
at hd (main.js:92)
at md (main.js:190)
at Og (main.js:182)
at main.js:92
at m.unstable_runWithPriority (main.js:26)
at hd (main.js:92)
I deleted .shadow-cljs and resources/public/js/main to catch caching issues. Is there someplace else I should clean? I set optimizations to whitespace and cache-level to off. Both does not help.
@holyjak @thheller thank you!!! I caught it with git bisect. I had changed m/set-value! to m/set-value!! where I should not have. @tony.kay Is there an FAQ or troubleshooting collection where I should note for posterity: If furlcro+shadow-cljs dev works and release does not: check your !!s ?
not sure why a release build should ever break anything like that
likely a bug. dev/release should not be different
if you’re using !! in a strange async context, then the bug might be with your code, and perhaps it was working “by accident” in dev
I have an input that changes :ui/filter-string
and then I (map ui-something filtered-things)
.
One day I thought I could add the extra ! to make that faster. The commit literally adds one ! in two places. I think it is react methods that blow. So it could be react-dev vs react-prod related. Or a timing thing. But you are of course right my code propably worked by accident in dev.
Happy you solved this!
map
is lazy. Most of the DOM stuff forces children so that laziness doesn’t bite you, but it’s something to think about
Can you look at the props of the component on React dev tools? Is it possible it somehow lost the Fulcro props?! (Or try-catch and console.log this
)
Each Fulcro component has in its props a reference to the global app (look at how comp/any->app works) so research where is the chain broken
@magra run shadow-cljs release app --debug
which should make it easier to pin down whats wrong
@thheller npx shadow-cljs release -A:ui prod --debug
shadow-cljs - config: /usr/home/markus/Code/cljc/hhh/shadow-cljs.edn
shadow-cljs - connected to server
NPM dependency "@js-joda/timezone" has installed version "2.5.0"
"2.2.0" was required by jar:file:/usr/home/markus/.m2/repository/tick/tick/0.4.30-alpha/tick-0.4.30-alpha.jar!/deps.cljs
NPM dependency "@js-joda/locale_en-us" has installed version "3.2.2"
"3.1.1" was required by jar:file:/usr/home/markus/.m2/repository/tick/tick/0.4.30-alpha/tick-0.4.30-alpha.jar!/deps.cljs
NPM dependency "react-grid-layout" has installed version "1.2.0"
"^0.16.6" was required by jar:file:/usr/home/markus/.m2/repository/com/github/awkay/workspaces/1.0.3/workspaces-1.0.3.jar!/deps.cljs
NPM dependency "highlight.js" has installed version "10.6.0"
"^9.12.0" was required by jar:file:/usr/home/markus/.m2/repository/com/github/awkay/workspaces/1.0.3/workspaces-1.0.3.jar!/deps.cljs
[:prod] Compiling ...
Using Wrapped inputs
[:prod] Build completed. (647 files, 190 compiled, 0 warnings, 19,62s)
@magra do the thing you did in the browser to trigger the error, the build log doesn't change
oh wait .. nvm. I missed that you were using :whitespace
anyways
well should still be easier with source maps