clojurescript 2025-04-30

Hi, I've got an issue with the latest release of clojurescript 1.12.35 in a shadow-cljs 3.0.3 build. The issue seems to be around laziness where if I filter a lazy seq that results in filtering out all the elements if the lazy seq is too large it results in a Maximum call stack size exceeded error. The following code shows the issue

(let [things (zipmap (range 15000) (repeat 0))]
  (count (filter #(-> % key string?) things)))
If you change it so that the filter is non lazy by using filterv the issue doesn't happen. Also, if the filter results in a non empty collection the issue doesn't happen. Does this seem like a bug?

@stuart055 Can you try with shadow-cljs 3.0.4?

👀 1

It works. Thank you for helping get this resolved

👍 2
🥳 1

A tiny correction - "filter a lazy seq" sounds like the things collection is lazy, but it is not - it's a regular map. But yeah, it does seem like a bug.

yes, we were looking at that commit @thheller (I work with @stuart055)

don't see how anything in shadow-cljs would affect this, so thats my only real guess looking at the cljs commit history

Yes, I could reproduce it with vanilla.

🙌 2

Thank you for the help so far, is there somewhere more official I should be raising this, or is here enough?

I posted it in #cljs-dev. Feel free to pop by and add any useful details.

🙌 1