fulcro

Book: http://book.fulcrologic.com, Community Resources: https://fulcro-community.github.io/, RAD book at http://book.fulcrologic.com/RAD.html
magra 2021-03-31T16:01:30.277800Z

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)

magra 2021-03-31T16:05:37.279400Z

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.

magra 2021-04-01T17:26:12.298400Z

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

tony.kay 2021-04-01T17:44:25.298600Z

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

tony.kay 2021-04-01T17:46:02.298800Z

likely a bug. dev/release should not be different

tony.kay 2021-04-01T17:46:38.299Z

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

magra 2021-04-01T17:58:42.299200Z

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ý 2021-04-01T19:04:35.299400Z

Happy you solved this!

tony.kay 2021-04-01T20:45:17.299700Z

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

Jakub Holý 2021-03-31T16:22:43.279800Z

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

thheller 2021-03-31T16:33:31.280600Z

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

magra 2021-03-31T16:37:41.282Z

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

thheller 2021-03-31T16:38:50.282700Z

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

thheller 2021-03-31T16:39:43.283300Z

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

thheller 2021-03-31T16:39:57.283500Z

well should still be easier with source maps