Fork me on GitHub
Drew Verlee00:12:14

i'm able to eval expressions in one file but not another in the same project. my emacs buffers says its connected in one but not the other. I can't imagine how this could be.


sorry can't answer emacs questions at all

Drew Verlee15:12:12

What editor do you use if i might ask?



👍 1

Maybe I'm misunderstanding something, but here goes. I have :paths ["src/main" "resources"] in deps.edn and :dev-http {8000 "classpath:public"} in shadow-cljs.edn. The dev server serves index.html correctly from resources/public when requested from localhost:8000, but any other URL results in 404. From the, I would expect that resources/public/index.html is served, rather than resulting in 404, correct? If I change to :dev-http {8000 "resources/public"} it works as expected. Wondering if its caused by something in shadow.http.push-state/handle.


yes, that handler assumes files not resources


feel free to open an issue about this. can't get to it right now


Ok, working today and suddenly I'm getting errors about a node package not being available, even though it was there the a second ago. I restarted the computer (it helped yesterday) and to no avail today. Error message is :

pnx-web.js:1455 Module not provided: module$node_modules$primereact$menu$menu_cjs


Updated all packages that had updates (re-frame-10x and shadow-cljs) .. compiler runs fine, imports are present.


If I look at the included js in chrome, I can navigate through node modules to get to the offending module and it does appear to be there.

shadow$provide["module$node_modules$primereact$menu$menu_cjs"] = function(global,require,module,exports) ...


Ooh, It may have been an errant capital P in the import, but not sure yet.


Nope, it does not seem to have been that.

David Vujic17:12:09

Could it be something with ES vs CommonJs imports? Maybe you have updated a dependency with breaking changes?


Thats a good question. I'm using a great many prime react modules and the rest seem to work. The update I did that seemed to trigger this was updating IntelliJ, tho I can't clearly see what that would have impacted.


When I first did that (yesterday), the Button module wasn't working, but a reboot got everything going again and button has not been cranky since


Ok so I think the errant capital P has lived on


SHADOW_ENV.evalLoad("module$node_modules$primereact$menu$menu_cjs.js", true, "shadow$provide.module$node_modules$Primereact$menu$menu_cjs\x3dfunction(global,require,module,exports) ...


There's def. no reference to PrimereactMenu in the requires anymore (there was 1) .. I nuked it from orbit, but it seems like something somewhere has cached it? The rest of the modules are lowercase as they should be.

David Vujic17:12:49

I guess you've already tried it, but if you haven't already: a rm -rf node_modules and an npm install usually does the trick 😄


hmm I tried npm ci but the shouldn't hurt!


I've tried so many things to get my project building in last 3 hours that I cant remember what I did when 😄

David Vujic17:12:25

Another trick is to go back in git history step by step until things start working again 😄

👍 1

So the compile process is generating references to Primereact still.. if I go into the compiled files and edit them all back to lowercase my project is back


There is one that pops back into the compiled file every time, not sure where its getting it from


The SHADOW_ENV stuff


@U05224H0W any clues? I'm stumped at how to fix this. I checked the js module itself for references to Primereact instead or primereact and it does not appear to be causing the capital P to recur.


did you try wiping .shadow-cljs/builds and restarting shadow-cljs?


I don't really know what you are doing but usually errors such as this are user errors


ie. did you modify your :modules config but did not adjust actually loading those modules in your HTML?


did you maybe change your :output-dir and just continue loading a mix of old and new files?


I am almost certain it is user error 🙂


I definitely had an errant require statement with a capital P, which I then eliminated but builds after kept going back to it regardless of npm ci / rebuild npm etc.


Nuking the .shadow-cljs/builds folder fixed it!


which shadow-cljs version do you use?