Fork me on GitHub

Hey, I noticed that cuerdas doesn't work with shadow-cljs. Cuerdas bundles xregexp.js as a resource, but shadow-cljs seems to be messing with it. Running npm install xregexp doesn't help, it then gives another error:

The required JS dependency "core-js/library/fn/array/is-array" is not available, it was required by "node_modules/@babel/runtime-corejs2/core-js/array/is-array.js".

Searched in:<my-project>/node_modules

You probably need to run:
  npm install core-js/library/fn/array/is-array
Neither this instruction, nor npm install core-js help. Has anyone else had success using cuerdas "2.2.0" on the client with shadow-cljs?


Does npm install [email protected]^2 work?


core-js unfortunately has a bunch of incompatible versions


it should be working normally but you might just have some version conflicts


Can someone explain how to use shadow with CIDER? I was able to get an absolute minimum with shadow-cljs.edn and a single :dev build targeted for :node-script, it works when I do shadow-cljs watch dev in one terminal window and node target/app.js in the other, but I just want to CIDER-jack-in. When I jack-in-cljs: - it first prompts me with the type of REPL, to which I say “shadow”, there’s also “shadow-select”, which I believe is the same thing. - then it prompts me again for a build, I choose :dev, - then it prompts me for the third time, asking if I want to launch a browser (wtf?). Anyway, it kinda works, but what bothers me - it doesn’t print anything, anywhere (unlike when I run the app like above). My :devtools {:after-load function, I can’t tell if it’s firing or not. I tried setting (enable-console-print!) and (node/enable-util-print!) - it’s not printing


I also tried setting up deps.edn with shadow-cljs - and failed at that as well. Anyway - my end goal is to run Puppeteer scripts, I believe I have to use :target :node-script for that. But why it’s not printing anything? prn doesn’t appear to be working, neither js/console.log. It’s not complaining, there’s simply no output anywhere


I probably can figure out how to set some elisp vars in .dir-locals.el so it doesn’t bother me with those silly prompts, but I can’t figure out how to print


@ag I can't help with the cider side of things since I don't use it. as for the shadow-cljs side of things you should NEVER call any of the enable-print methods since that messes with the print methods shadow-cljs already sets up


the print output is currently only available in the process in the launched node process


@ag I followed that and it seemed to be working ok (for browser target)


@ag when it prompts for the build, type dev not :dev


it prompts you to open a browser because most people are using CLJS in the browser.


you also still must run the node process in a terminal


@ag so the full steps should be: 1. Run cider-jack-in-clojurescript 2. Select shadow 3. Choose dev 4. Press n to not open a browser Once the build has completed once, in a terminal run the command: node target/app.js and you should see your console.log println etc. show up in the Node process terminal

Daw-Ran Liou22:07:25

Can dev http server redirect not just to index.html but also other files? Currently I have the below files under the public folder. There are both static pages (`index.html`, log-in.html, and sign-up.html) and my single page app (`app/index.html`). I want the single page app to handle all the routing under the path /app/*, for example /app/profile. However, when loading /app/profile, the dev server falls back to public/index.html. Any suggestion is welcome.



@dawranliou I didn't check it locally but did you try to set multiple roots?:


I'd imagine the roots to be setup as ["public/app" "app"]

Daw-Ran Liou23:07:55

Thanks. I just gave it a try but it didn’t work because path /app/profile does not match any file under those two roots, and thus the default handler was called.

Daw-Ran Liou23:07:33

But I think you gave me a direction. The :push-state/index key might be the one I am looking for.


Ah good. I hope it will work out with it.

Daw-Ran Liou23:07:58

This might not be exactly what I want but hope it’ll work. The right way to do it might be to write a custom handler:

Daw-Ran Liou23:07:20

Thanks again for helping out @alpox 🙂


@dawranliou No problem. I'm sure you'll figure out something that works for you 🙂