Fork me on GitHub
#fulcro
<
2021-03-31
>
magra16:03:30

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)

magra16:03:37

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.

Jakub Holý (HolyJak)16:03:43

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

magra17:04:12

@U0522TWDA @thheller thank you!!! I caught it with git bisect. I had changed m/set-value! to m/set-value!! where I should not have. @U0CKQ19AQ 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 ?

tony.kay17:04:25

not sure why a release build should ever break anything like that

tony.kay17:04:02

likely a bug. dev/release should not be different

tony.kay17:04:38

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

magra17:04:42

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.

Jakub Holý (HolyJak)19:04:35

Happy you solved this!

tony.kay20:04:17

map is lazy. Most of the DOM stuff forces children so that laziness doesn’t bite you, but it’s something to think about

thheller16:03:31

@magra run shadow-cljs release app --debug which should make it easier to pin down whats wrong

magra16:03:41

@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)

thheller16:03:50

@magra do the thing you did in the browser to trigger the error, the build log doesn't change

thheller16:03:43

oh wait .. nvm. I missed that you were using :whitespace anyways

thheller16:03:57

well should still be easier with source maps