This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-01-12
Channels
Anyone using shadow-cljs with react-native? In my project every time I make a change to a cljs file it will update quickly (using Fast Refresh I assume?), but then a couple seconds later it will rebuild/re-download the bundle.
I’m wondering if there’s some configuration I can change, or a different way to set up the project that will avoid the re-downloading every time
I ran into this problem. Ctrl-M in the emulator brought up the menu for me where I could disable fast-refresh.
If you're new to CLJS/RN like I am, I made a repo with a single commented file that has the bare-minimum setup. It helped me and if you're new too you might find it useful. https://github.com/eihli/cljs-react-native-starter/blob/master/src/example/core.cljs
@UJP37GW2K you never require devtools.core
. if you need it you add it to your build config :devtools {:preloads [devtools.preload]}
Hi, I am trying to make TextInput from Material-ui working within our project, where the problem was reported by my colleagues couple days back: We require this:
["@material-ui/core/TextField" :default TextField]
We get the following error in the console:
js.js:74 shadow-cljs - failed to load module$node_modules$$material_ui$core$Select$SelectInput
shadow.js.jsRequire @ js.js:74
shadow$provide.module$node_modules$$material_ui$core$Select$Select @ Select.js:21
shadow.js.jsRequire @ js.js:66
shadow$provide.module$node_modules$$material_ui$core$Select$index @ index.js:16
shadow.js.jsRequire @ js.js:66
shadow$provide.module$node_modules$$material_ui$core$TextField$TextField @ TextField.js:37
shadow.js.jsRequire @ js.js:66
shadow$provide.module$node_modules$$material_ui$core$TextField$index @ index.js:16
shadow.js.jsRequire @ js.js:66
shadow.js.require @ js.js:100
(anonymous) @ orgpad.client.views.widgets.text_field.js:3
js.js:74 shadow-cljs - failed to load module$node_modules$$material_ui$core$Select$Select
shadow.js.jsRequire @ js.js:74
shadow$provide.module$node_modules$$material_ui$core$Select$index @ index.js:16
shadow.js.jsRequire @ js.js:66
shadow$provide.module$node_modules$$material_ui$core$TextField$TextField @ TextField.js:37
shadow.js.jsRequire @ js.js:66
shadow$provide.module$node_modules$$material_ui$core$TextField$index @ index.js:16
shadow.js.jsRequire @ js.js:66
shadow.js.require @ js.js:100
(anonymous) @ orgpad.client.views.widgets.text_field.js:3
js.js:74 shadow-cljs - failed to load module$node_modules$$material_ui$core$Select$index
shadow.js.jsRequire @ js.js:74
shadow$provide.module$node_modules$$material_ui$core$TextField$TextField @ TextField.js:37
shadow.js.jsRequire @ js.js:66
shadow$provide.module$node_modules$$material_ui$core$TextField$index @ index.js:16
shadow.js.jsRequire @ js.js:66
shadow.js.require @ js.js:100
(anonymous) @ orgpad.client.views.widgets.text_field.js:3
js.js:74 shadow-cljs - failed to load module$node_modules$$material_ui$core$TextField$TextField
shadow.js.jsRequire @ js.js:74
shadow$provide.module$node_modules$$material_ui$core$TextField$index @ index.js:16
shadow.js.jsRequire @ js.js:66
shadow.js.require @ js.js:100
(anonymous) @ orgpad.client.views.widgets.text_field.js:3
js.js:74 shadow-cljs - failed to load module$node_modules$$material_ui$core$TextField$index
shadow.js.jsRequire @ js.js:74
shadow.js.require @ js.js:100
(anonymous) @ orgpad.client.views.widgets.text_field.js:3
js.js:75 Uncaught TypeError: Cannot read property 'isRequired' of undefined
at Object.shadow$provide.module$node_modules$$material_ui$core$Select$SelectInput (SelectInput.js:453)
at shadow.js.jsRequire (js.js:66)
at Object.shadow$provide.module$node_modules$$material_ui$core$Select$Select (Select.js:21)
at shadow.js.jsRequire (js.js:66)
at Object.shadow$provide.module$node_modules$$material_ui$core$Select$index (index.js:16)
at shadow.js.jsRequire (js.js:66)
at Object.shadow$provide.module$node_modules$$material_ui$core$TextField$TextField (TextField.js:37)
at shadow.js.jsRequire (js.js:66)
at Object.shadow$provide.module$node_modules$$material_ui$core$TextField$index (index.js:16)
at Object.shadow.js.jsRequire (js.js:66)
It was suggested that the problem is with a conflict of dependencies. Any ideas how to do debugging?these are all the dependencies we currently use:
"dependencies": {
"@material-ui/core": "^4.8.0",
"bezier-js": "^2.4.4",
"create-react-class": "^15.6.3",
"deps": "^0.1.2",
"process": "^0.11.10",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-motion": "^0.5.2",
"webfontloader": "^1.6.28"
},
check which one material-ui expects and which one you have in node_modules/prop-types
we have "[email protected]"
in the minimal working example, we have "[email protected]"
ya, there is on
with 15.7.2
so what is the solution? adding this dependency directly into our project?
I have tested to add it and it runs fine 🙂
hmm, what are the alternatives? we basically want to get reasonable UI elements without spending much time with it
anyway, thx a lot for help, I will have to learn to read JS packages better
hopefully we get everything running soon
how the npm modules have versions chosen? why did we got the older version for prop-types?
its a common package. some other package you installed also depended on the older version
why is not the largest needed version installed? it seems that also react and react-motion depended on it
ok, complexity lurks everywhere out there 🙂 anyway thx a lot
I'm trying shadow-cljs out for the first time and hoping to use this lib. Installs fine via npm but when I try to require and use as in the examples the object import is empty
So in short, hoping someone has tips in using an npm lib using babel, ts and rollup.js (most of which I generally understand but don't have experience with)
@UQR2E9W15 Hi! I’m setting up shadow-cljs with monaco-editor and rollup.js too. Change the config a little bit and that will work with typescript. Maybe it can help you. https://github.com/just-sultanov/clj-monaco
Hey @U1EQNSHL4 thanks so much for the tip! I ended up getting around rollup etc. by requiring the min file directly like so:
["rete/build/rete.min.js" :as rete]