shadow-cljs

Pepijn de Vos 2025-09-01T09:24:37.541959Z

Owneeeeew! On my release build I'm getting SES_UNCAUGHT_EXCEPTION: Error: [object Object] is not ISeqable but even with debug it works fine

shadow-cljs release frontend --debug

Pepijn de Vos 2025-09-01T10:01:48.567519Z

but what's weird is that it's tripping up on one specific schematic

Pepijn de Vos 2025-09-01T10:05:17.420039Z

and of course it's in a fkn go block

Pepijn de Vos 2025-09-01T10:14:31.795329Z

it appears that js->clj chokes on my data

Pepijn de Vos 2025-09-01T10:17:33.632779Z

#js [#js {:id 1c197084-0f79-4575-810d-c30e4c33fd6c:M1, :key 1c197084-0f79-4575-810d-c30e4c33fd6c:M1, :value #js {:rev 7-d04d58e9f59e62723cabb71ff1abc560}, :doc #js {:y 3, :transform #js [1 0 0 1 0 0], :name M1, :type nmos, :x 5, :model 17bcc564-4e96-4f90-8e91-d7c55c887707, :props #js {:m 100}, :_id 1c197084-0f79-4575-810d-c30e4c33fd6c:M1, :_rev 7-d04d58e9f59e62723cabb71ff1abc560}} #js {:id 1c197084-0f79-4575-810d-c30e4c33fd6c:P1, :key 1c197084-0f79-4575-810d-c30e4c33fd6c:P1, :value #js {:rev 1-e694ff0a1859c48d94ac313f48979290}, :doc #js {:transform #js [-1 1.2246467991473532e-16 -1.2246467991473532e-16 -1 0 0], :type port, :x 6, :y 3, :name P1, :_id 1c197084-0f79-4575-810d-c30e4c33fd6c:P1, :_rev 1-e694ff0a1859c48d94ac313f48979290}} #js {:id 1c197084-0f79-4575-810d-c30e4c33fd6c:P2, :key 1c197084-0f79-4575-810d-c30e4c33fd6c:P2, :value #js {:rev 1-8f6f87af291515b8b4d454050da99c80}, :doc #js {:transform #js [6.123233995736766e-17 -1 1 6.123233995736766e-17 0 0], :type port, :x 5, :y 6, :variant ground, :name GND, :_id 1c197084-0f79-4575-810d-c30e4c33fd6c:P2, :_rev 1-8f6f87af291515b8b4d454050da99c80}} #js {:id 1c197084-0f79-4575-810d-c30e4c33fd6c:R1, :key 1c197084-0f79-4575-810d-c30e4c33fd6c:R1, :value #js {:rev 2-941dc7eab224f523645a1cf48c4c6fea}, :doc #js {:transform #js [1 0 0 1 0 0], :type resistor, :x 5, :y 1, :name R1, :props #js {:resistance 1k}, :_id 1c197084-0f79-4575-810d-c30e4c33fd6c:R1, :_rev 2-941dc7eab224f523645a1cf48c4c6fea}} #js {:id 1c197084-0f79-4575-810d-c30e4c33fd6c:V1, :key 1c197084-0f79-4575-810d-c30e4c33fd6c:V1, :value #js {:rev 3-972eb5a4f1d5cafabe5bb418f5e32d34}, :doc #js {:transform #js [1 0 0 1 0 0], :type vsource, :x 1, :y 3, :name V1, :props #js {:dc 1.8}, :_id 1c197084-0f79-4575-810d-c30e4c33fd6c:V1, :_rev 3-972eb5a4f1d5cafabe5bb418f5e32d34}} #js {:id 1c197084-0f79-4575-810d-c30e4c33fd6c:V2, :key 1c197084-0f79-4575-810d-c30e4c33fd6c:V2, :value #js {:rev 6-755024e5f76bce5f344693c5bff924cc}, :doc #js {:transform #js [1 0 0 1 0 0], :type vsource, :x 3, :y 4, :name V2, :props #js {:dc 0.5, :ac 1, :tran sin(0.5 0.5 1k)}, :_id 1c197084-0f79-4575-810d-c30e4c33fd6c:V2, :_rev 6-755024e5f76bce5f344693c5bff924cc}} #js {:id 1c197084-0f79-4575-810d-c30e4c33fd6c:W1, :key 1c197084-0f79-4575-810d-c30e4c33fd6c:W1, :value #js {:rev 2-a509232c8b28d3f27afc8bbcff5abe30}, :doc #js {:type wire, :x 6, :y 5, :rx 0, :ry 1, :name W1, :_id 1c197084-0f79-4575-810d-c30e4c33fd6c:W1, :_rev 2-a509232c8b28d3f27afc8bbcff5abe30}} #js {:id 1c197084-0f79-4575-810d-c30e4c33fd6c:W2, :key 1c197084-0f79-4575-810d-c30e4c33fd6c:W2, :value #js {:rev 4-7898506309afbdb9d39bd2423ffad0d5}, :doc #js {:y 6, :rx 2, :transform #js [1 0 0 1 0 0], :name W2, :type wire, :x 2, :ry 0, :_id 1c197084-0f79-4575-810d-c30e4c33fd6c:W2, :_rev 4-7898506309afbdb9d39bd2423ffad0d5}} #js {:id 1c197084-0f79-4575-810d-c30e4c33fd6c:W3, :key 1c197084-0f79-4575-810d-c30e4c33fd6c:W3, :value #js {:rev 4-ee4e08d2cecc8740a93db34e1bbcc9df}, :doc #js {:y 6, :rx 1, :transform #js [1 0 0 1 0 0], :name W3, :type wire, :x 4, :ry 0, :_id 1c197084-0f79-4575-810d-c30e4c33fd6c:W3, :_rev 4-ee4e08d2cecc8740a93db34e1bbcc9df}} #js {:id 1c197084-0f79-4575-810d-c30e4c33fd6c:W38, :key 1c197084-0f79-4575-810d-c30e4c33fd6c:W38, :value #js {:rev 3-6d4df0411243c3dad3b384a6f3208edc}, :doc #js {:type wire, :transform #js [1 0 0 1 0 0], :x 5, :y 6, :rx 1, :ry 0, :_id 1c197084-0f79-4575-810d-c30e4c33fd6c:W38, :_rev 3-6d4df0411243c3dad3b384a6f3208edc}} #js {:id 1c197084-0f79-4575-810d-c30e4c33fd6c:W4, :key 1c197084-0f79-4575-810d-c30e4c33fd6c:W4, :value #js {:rev 1-8ed68aac4e80e714a79fde17c832f11d}, :doc #js {:type wire, :x 2, :y 6, :rx 0, :ry -1, :name W4, :_id 1c197084-0f79-4575-810d-c30e4c33fd6c:W4, :_rev 1-8ed68aac4e80e714a79fde17c832f11d}} #js {:id 1c197084-0f79-4575-810d-c30e4c33fd6c:W5, :key 1c197084-0f79-4575-810d-c30e4c33fd6c:W5, :value #js {:rev 2-83474e98864e4396b51bd2dffb9dbf5a}, :doc #js {:type wire, :x 2, :y 1, :rx 4, :ry 0, :name W5, :_id 1c197084-0f79-4575-810d-c30e4c33fd6c:W5, :_rev 2-83474e98864e4396b51bd2dffb9dbf5a}} #js {:id 1c197084-0f79-4575-810d-c30e4c33fd6c:W6, :key 1c197084-0f79-4575-810d-c30e4c33fd6c:W6, :value #js {:rev 1-dd7ffccbd4aa802c61e87ff2117a2b9a}, :doc #js {:type wire, :x 6, :y 4, :rx 0, :ry 1, :name W6, :_id 1c197084-0f79-4575-810d-c30e4c33fd6c:W6, :_rev 1-dd7ffccbd4aa802c61e87ff2117a2b9a}} #js {:id 1c197084-0f79-4575-810d-c30e4c33fd6c:W7, :key 1c197084-0f79-4575-810d-c30e4c33fd6c:W7, :value #js {:rev 1-be37be0da3c51fd944c24347d6e36666}, :doc #js {:type wire, :x 5, :y 4, :rx -1, :ry 0, :name W7, :_id 1c197084-0f79-4575-810d-c30e4c33fd6c:W7, :_rev 1-be37be0da3c51fd944c24347d6e36666}} #js {:id 1c197084-0f79-4575-810d-c30e4c33fd6c:W8, :key 1c197084-0f79-4575-810d-c30e4c33fd6c:W8, :value #js {:rev 1-064c557cdec6fe697ab840f9b036303c}, :doc #js {:type wire, :x 2, :y 1, :rx 0, :ry 2, :name W8, :_id 1c197084-0f79-4575-810d-c30e4c33fd6c:W8, :_rev 1-064c557cdec6fe697ab840f9b036303c}}] common.js:4387:191
SES_UNCAUGHT_EXCEPTION: Error: [object Object] is not ISeqable

Pepijn de Vos 2025-09-01T10:18:53.104739Z

Okay so I found the spot where I can print the data, and then the js->clj line errors in release mode

Pepijn de Vos 2025-09-01T10:33:04.763319Z

okay insane trace:

debug({"m":"1"})
{m 1} common.js:4387:191
null
debug({"mo":"1"})
{mo 1} common.js:4387:191
null
debug({"mo":"10"})
{mo 10} common.js:4387:191
null
debug({"m":"10"})
Uncaught Error: [object Object] is not ISeqable

Harold 2025-09-01T18:23:51.806719Z

I have a question about how println makes it up to my terminal and npx shadow-cljs node-repl ... in 🧵

thheller 2025-09-04T14:03:15.750339Z

thats where the node process is started and the stdout/stderr captures are added

Harold 2025-09-01T18:29:49.992749Z

I can start a repl, and start an http server ...

$ npx shadow-cljs node-repl
shadow-cljs - config: /home/harold/src/node-server-test/shadow-cljs.edn
shadow-cljs - server version: 3.2.0 running at 
shadow-cljs - nREPL server started on port 41933
cljs.user=> shadow-cljs - #4 ready!
(require '["process" :as process])
nil
cljs.user=> (println (.-pid process))
78270
nil
cljs.user=> (defn handler [req res] (println (str "INSIDE: " (.-pid process))) (.write res (str "Hello, from: " (.-pid process))) (.end res))
#'cljs.user/handler
cljs.user=> (require '["http" :as http])
nil
cljs.user=> (def s (http/createServer handler))
#'cljs.user/s
cljs.user=> (.listen s 8000)
#object[Server [object Object]]
Then, in another terminal, I can do...
$ curl localhost:8000
Hello, from: 78270
And, back in the original repl terminal, I see...
cljs.user=> 
INSIDE: 78270
This is great! But for the first time, I'm wondering how this all works ... 78270 is the pid of a node process, that as far as I can tell was started from a java process /usr/bin/java -cp [snip...] clojure.main -m shadow.cljs.devtools.cli --npm node-repl Does shadow explicitly hook up the pipes so the node process stdout makes it up through the chain? cc: @alexyakushev

Harold 2025-09-01T18:36:06.703919Z

$ pstree -p 78100
npm exec shadow(78100)─┬─sh(78111)───node(78112)─┬─java(78119)─┬─node(78270)