shadow-cljs

Gerome 2026-03-06T12:26:22.268959Z

Hello everyone! I'm using shadow-cljs 3.3.6 and I'm trying to get it to proxy to my webserver which is listening on localhost:3000. Shadow-cljs is running my dev-http on 8000 and I have a proxy url configured. :dev-http {8000 {:root "resources/public" :proxy-url ""}}. However, when I now open my webapp on localhost:3000, I get a 404. 😮 In the https://shadow-cljs.github.io/docs/UsersGuide.html#dev-http-proxy the URL used is not localhost. Could it be that this is occurring because both are pointing to localhost and localhost:3000 doesn't have anything under /?

Gerome 2026-03-06T12:32:34.782739Z

Hm, no, I also just tried using 127.0.0.1:3000 instead of localhost and I also tried using an alias set in /etc/hosts

thheller 2026-03-06T20:01:06.144639Z

why are you using a proxy in the first place? can you not just make the server on :3000 serve the static .js files?

👍 1
thheller 2026-03-06T20:01:55.374819Z

if you are talking to :3000 directly then the shadow-cljs.edn config will have absolutely nothing to do with it. so the 404 is coming from your server?

thheller 2026-03-06T20:04:37.143499Z

maybe you are expecting the :8000 server to server resources/public/index.html? in that case you might want to add :use-index-files true do the :dev-http config for 8000?

Gerome 2026-03-07T05:22:44.891349Z

Oh it seems I misunderstood something. I thought configuring proxy-url would make the shadow-cljs dev server proxy certain URLs. Is that's not what it’s for? That would explain why I didn’t have to configure a route to proxy. I'll probably just try to make my server serve the files, then.

thheller 2026-03-07T06:07:47.433369Z

proxy url proxies requests from the :dev-http to the :proxy-url. not the other way. it can't do anything with request going to proxy-url directly.

Gerome 2026-03-07T17:17:30.184989Z

Thanks for clearing that up

doojin 2026-03-06T13:18:40.924869Z

Can I perhaps make a guix source package out of a shadow-cljs frontend? Guix has node-build-system and clojure-build-system. If neither build system is good enough, I can perhaps write a new build system after learning guix.

thheller 2026-03-06T20:06:11.995139Z

no clue what guix is or what that entails. if its just esm files then :target :esm probably just works.

doojin 2026-03-07T00:06:26.434639Z

It's like nix. Every dependency is a package in /guix/store/package_hash-package_name-version. They are combined with environment variables like JVM_CLASSPATH="/guix/store/xxx-clojure-1.0:/guix/store/xxx-missionary-1.0:...". JVM classpath can be built like this?

doojin 2026-03-07T00:08:46.287189Z

I guess npm dependencies are directly inserted into dependent packages as symlinks without environment variable.

doojin 2026-03-07T00:10:35.257529Z

I suspect shadow-cljs works with this without internet access once all dependencies are gathered in node_modules and JVM classpath by guix. I will probably have to write new guix build systems for this.

doojin 2026-03-07T00:11:22.189039Z

If it doesn't work out, I can fall back to uberjars... and other forms of binary build.

doojin 2026-03-07T00:32:57.046029Z

I want to turn clojure and clojurescript into first-class citizens on gnu guix. Right now, guix users just use clj from clojure-tools. I suspect I just need to write a guix build system or two, or three for this. If I assemble node_modules symlinks and JVM classpath from guix store paths, then maybe it all works out.

doojin 2026-03-07T01:13:14.853999Z

Do you think it can work?

thheller 2026-03-07T06:11:01.124359Z

no clue. don't know guix. I'm deeply skeptical of one package manager wrapping another wrapping another, so not something I think is worth doing.

thheller 2026-03-07T06:12:02.143259Z

that being said .. shadow-cljs is basically just a clojure library. it runs anywhere if you have something that can construct a proper classpath for it. I wrote about that a long time ago https://code.thheller.com/blog/shadow-cljs/2017/11/18/the-many-ways-to-use-shadow-cljs.html

doojin 2026-03-07T06:19:18.410189Z

Linux distribution package maintainers wrote complex code for python packages, but guix and guile scheme make it relatively simple as long as you understand individual language-specific build systems. I think you are right to be skeptical if you don't see value in installing dependencies as linux distribution packages. Most clojure projects are proprietary projects which end up in uberjars anyway... I just like doing everything through linux distribution packages if that can be done in a reasonable timeframe.

doojin 2026-03-07T09:07:34.755989Z

I realized that replicating the build steps in guix is going to be duplication of work. Perhaps, it's best to just make guix packages out of pre-built binaries like uberjars. This way, I can still get declarative system configuration without having to learn and duplicate build steps.

doojin 2026-03-07T09:31:05.674809Z

Okay, I decided to focus on app development instead of infrastructure development. Guix will be used like ansible, but I will make guix packages out of pre-built binaries.

doojin 2026-03-07T09:32:02.304569Z

When I have spare money in my business, I can perhaps hire someone to write guix source packages... But, I personally won't.

doojin 2026-03-06T13:21:29.627599Z

Does shadow-cljs or clojurescript support javascript import map?

thheller 2026-03-06T20:07:04.605329Z

thats not a build tool question. thats a runtime question. as in import maps tell the runtime where to find dependencies. and yes shadow-cljs supports building code that can make use of import maps