Fork me on GitHub
#shadow-cljs
<
2021-10-06
>
thheller05:10:49

@chris358 that is not your requires, that is the require in those files. most likely they are doing some kind of dynamic require, eg. not require("some-string") but require(some_variable)

👍 1
thheller05:10:58

for :target :esm intended for node you want to set :js-options {:js-provider :import}. otherwise shadow-cljs will attempt to bundle everything which won't work for many node things

Ben Halton08:10:13

hi not sure if this is a shadow issue per se but since upgrading to react 17 we seem to have lost our code from the stack when getting errors in the console, so pre 17 we would get something like:

Warning: Failed prop type: The prop `open` is marked as required in `ForwardRef`, but its value is `null`.
    in ForwardRef (created by WithStyles(ForwardRef))
    in WithStyles(ForwardRef) (created by ui.views.reports.reports_dialog.render)
    in ui.views.reports.reports_dialog.render (created by ui.views.reports.reports_dialog.init)
    in ui.views.reports.reports_dialog.init (created by ui.views.meeting.home.render)
where ui.views.* is our code since upgrading we get:
Warning: Failed prop type: The prop `open` is marked as required in `ForwardRef`, but its value is `null`.
    at eval ()
    at eval ()
    at cmp ()
    at cmp ()
    at div
    at eval ()
    at cmp ()
so no pointer to our code at all which obviously makes it hard to work out what's up.

Ben Halton08:10:07

I don't really have a good idea of what might cause this but I know react 17 made some changes to the way the code is organised

thheller08:10:09

@gingerwizard I'm guessing this is react? I haven't used react in a long time. don't know what changed in 17. only thing it looks like it is missing source maps?

Ben Halton09:10:38

I think in 17 react shipped as modules in some way that I'm afraid I don't fully understand

Ben Halton09:10:07

I'm not much of a UI guy really - if we are missing react source maps could that lead to not having our app code in the stack ?

Ben Halton09:10:00

looking at it in devtools I think I can see react source maps

Ben Halton10:10:51

fwiw I found a similar issue from a while back here that was closed without resolution, but shows at least it's unlikely to have anything to to with shadow https://github.com/mui-org/material-ui/issues/23600

thheller10:10:10

@gingerwizard source maps map the JS location back to the original yes but you should be getting warnings in the browser console if source maps fail to load

thheller10:10:49

if you get those it typically means that your :asset-path in your build config is misconfigured. if you get no warnings I would assume they loaded correctly and the problem is elsewhere

Ben Halton10:10:02

yup agreed :thumbsup::skin-tone-2: there is a problem in there somewhere - I would assume if it was a generic react 17 / mui issue the internet would be full of people complaining so likely something specific to our setup

Ben Halton10:10:07

well OK for anyone that reads this with a similar issue, I've been able to "resolve" it for now by rolling react back to 16.14.0. Unsatisfactory but seems to hang together for now

David Pham13:10:22

Hello 🙂 I am trying to use pnpm with shadow-cljs, and I appears that pnpm either does not install dependencies recursively, or that shadow-cljs does not work well with pnpm. Is there any shared experienced?

thheller05:10:08

if its all symlinks maybe try setting :js-options {:allow-nested-packages false} in your build config. it might get confused by all the links otherwise?

thheller17:10:16

@neo2551 never tried pnpm so not sure what it does. all shadow-cljs cares about is a node_modules directory with all the packages. don't know what that looks like with pnpm

thheller17:10:20

npm and yarn work fine

borkdude19:10:10

@thheller one difference might be that pnpm uses symbolic links instead of copying all the modules inside your node_modules dir, but like mvn it keeps each lib in a single place