Fork me on GitHub
#shadow-cljs
<
2023-07-25
>
ccann16:07:29

I have shadow-cljs successfully compiling my build and webpack bundling a release. All the assets seem to be resolved correctly when I visit the app URL. No console errors, but the page is just a blank white screen. No network errors, nothing to indicate it isn’t behaving as expected. This might not even be related to shadow-cljs anymore in which case please let me know and I’ll take the question elsewhere (this is a non-development build)

ccann16:07:03

I do get these warnings when webpack runs

[1m------ WARNING #1 -  -----------------------------------------------------------[0m
 File: /var/jenkins_home/workspace/loud_Projects_co.foo.my_PR-916@2/src/cljsjs/material_ui.cljs:8:6
--------------------------------------------------------------------------------
[2m   5 |             ["material-ui/utils/withWidth" :refer [default] :rename {default withWidth}][0m
[2m   6 |             ["material-ui/utils/colorManipulator" :refer [default] :rename {default colorManipulator}]))[0m
[2m   7 | [0m
[1m   8 | (set! js/MaterialUI MaterialUI)[0m
------------^-------------------------------------------------------------------
 [33;1mconstant MaterialUI assigned a value more than once.
Original definition at externs.shadow.js:4[0m
--------------------------------------------------------------------------------
[2m   9 | (set! js/MaterialUIStyles MaterialUIStyles)[0m
[2m  10 | (set! js/MaterialUIUtils #js {:withWidth withWidth[0m
[2m  11 |                               :colorManipulator colorManipulator})[0m
[2m  12 | [0m
--------------------------------------------------------------------------------
[1m------ WARNING #2 -  -----------------------------------------------------------[0m
 File: /var/jenkins_home/workspace/loud_Projects_co.foo.my_PR-916@2/src/cljsjs/material_ui.cljs:9:6
--------------------------------------------------------------------------------
[2m   6 |             ["material-ui/utils/colorManipulator" :refer [default] :rename {default colorManipulator}]))[0m
[2m   7 | [0m
[2m   8 | (set! js/MaterialUI MaterialUI)[0m
[1m   9 | (set! js/MaterialUIStyles MaterialUIStyles)[0m
------------^-------------------------------------------------------------------
 [33;1mconstant MaterialUIStyles assigned a value more than once.
Original definition at externs.shadow.js:5[0m
--------------------------------------------------------------------------------
[2m  10 | (set! js/MaterialUIUtils #js {:withWidth withWidth[0m
[2m  11 |                               :colorManipulator colorManipulator})[0m
[2m  12 | [0m
--------------------------------------------------------------------------------
[1m------ WARNING #3 -  -----------------------------------------------------------[0m
 File: /var/jenkins_home/workspace/loud_Projects_co.foo.my_PR-916@2/src/cljsjs/material_ui.cljs:10:6
--------------------------------------------------------------------------------
[2m   7 | [0m
[2m   8 | (set! js/MaterialUI MaterialUI)[0m
[2m   9 | (set! js/MaterialUIStyles MaterialUIStyles)[0m
[1m  10 | (set! js/MaterialUIUtils #js {:withWidth withWidth[0m
------------^-------------------------------------------------------------------
 [33;1mconstant MaterialUIUtils assigned a value more than once.
Original definition at externs.shadow.js:7[0m
--------------------------------------------------------------------------------
[2m  11 |                               :colorManipulator colorManipulator})[0m
[2m  12 | [0m
--------------------------------------------------------------------------------
[1m------ WARNING #4 -  -----------------------------------------------------------[0m
 File: /var/jenkins_home/workspace/loud_Projects_co.flair.my_PR-916@2/src/cljsjs/material_ui_svg_icons.cljs:4:6
--------------------------------------------------------------------------------
[2m   1 | (ns cljsjs.material-ui-svg-icons[0m
[2m   2 |   (:require ["material-ui/svg-icons" :as MaterialUISVGIcons]))[0m
[2m   3 | [0m
[1m   4 | (set! js/MaterialUISvgIcons MaterialUISVGIcons)[0m
------------^-------------------------------------------------------------------
 [33;1mconstant MaterialUISvgIcons assigned a value more than once.
Original definition at externs.shadow.js:6[0m
--------------------------------------------------------------------------------
[2m   5 | [0m
--------------------------------------------------------------------------------
[1m------ WARNING #5 -  -----------------------------------------------------------[0m
 File: /var/jenkins_home/workspace/loud_Projects_co.foo.my_PR-916@2/src/cljsjs/react.cljs:4:6
--------------------------------------------------------------------------------
[2m   1 | (ns cljsjs.react[0m
[2m   2 |   (:require [react :as React]))[0m
[2m   3 | [0m
[1m   4 | (set! js/React React)[0m
------------^-------------------------------------------------------------------
 [33;1mconstant React assigned a value more than once.
Original definition at EXTERNS:resources/lib/ext/react.ext.js:12[0m
--------------------------------------------------------------------------------
[2m   5 | [0m
--------------------------------------------------------------------------------
[1m------ WARNING #6 -  -----------------------------------------------------------[0m
 Resource: com/cognitect/transit.js:649:8
 variable module is undeclared
--------------------------------------------------------------------------------
[1m------ WARNING #7 -  -----------------------------------------------------------[0m
 Resource: shadow.js.shim.module$react.js:3:30
 variable shadow$bridge is undeclared
--------------------------------------------------------------------------------
nil

ccann16:07:58

(this is shadow-cljs 2.15.1, which I am using because the current project I’m compiling isn’t compatible with versions of clojurescript beyond the one bundled with that version of shadow)

ccann16:07:18

could this be related

Resource: shadow.js.shim.module$react.js:3:30
 variable shadow$bridge is undeclared

thheller16:07:52

the above are not webpack warnings. those are shadow-cljs warnings?

thheller16:07:32

can't help you with ancient versions much

thheller16:07:12

the cljsjs shim files are supposed to look like this

🙏 2
thheller16:07:29

set! is incorrect, should be using js/goog.exportSymbol

thheller16:07:37

for react you don't really need them though, since they are already provided by default

ccann17:07:33

Ok, I think I fixed those warnings but I still get

------ WARNING #1 -  -----------------------------------------------------------
 Resource: shadow.js.shim.module$react.js:3:30
 variable shadow$bridge is undeclared
--------------------------------------------------------------------------------
nil
is this a warning I can ignore, or would you expect it to break the build? Not sure where to start to try to fix it

ccann18:07:54

it’s weird because I don’t get any of these compiler warnings when I do shadow-cljs watch app instead of shadow-cljs release app

thheller19:07:22

you are using a really old shadow-cljs version, I'm not going to diagnose this any further for you. there have been many issues in the past, I do not remember when this particular one was fixed

thheller19:07:30

it is just a warning though, so no biggie

👍 2
ccann14:07:26

Turns out I wasn’t actually including the compiled JS bundle in my webpack entry in addition to the index.js. :melting_face: