shadow-cljs 2025-05-26

I'm trying to update project dependencies and am getting a bit puzzling error:

The required JS dependency "events" is not available, it was required by "node_modules/pouchdb/lib/index-browser.js".
afaict "events" is a nodejs builtin so it seems something weird is going on because I'm trying to compile for browser

npm install events

So did pouchdb just... not include a dependency? reading the issues it seems like they might be doing something weird expecting the npm package to run on node but I'll try

a long time ago webpack used to do automatic polyfilling for node built-in packages, but they stopped supporting this out of the box since webpack v5 (5+ years ago)

guess that still isn't enough time for npm packages to adopt and adjust accordingly

problem is that for node you don't actually want this dependency, but for the browser you need it

tbh pouchdb isn't that actively developed

since npm packages can't tell what you are going to use this in they kinda don't have a choice

FWIW I also removed the automatic polyfilling in shadow-cljs 3+

guess I underestimated how relevant this still is 😛

okay indeed installing that just fixed the problem

thanks

After upgrading to React 18.3.1 and loading the survey-react-ui library, we get the error failed to load module$node_modules$survey_react_ui$fesm$survey_react_ui_mjs at line var module$node_modules$survey_react_ui$fesm$survey_react_ui_mjs = shadow.js.require("module$node_modules$survey_react_ui$fesm$survey_react_ui_mjs", {}); The extended class that is missing is class SurveyElementBase extends React.Component { Any directions on how to fix?

looks like the esm variant is used. dunno why that wouldn't work but did you configure it to do that manually? the default shouldn't pick that survey_react_ui$fesm$survey_react_ui_mjs file

which shadow-cljs version do you use?

ah in project.clj still using 2.20.13

maybe just bump that

thanks

alright that was it @thheller 🤦. Thanks for suggestion!