shadow-cljs

john 2025-04-28T22:57:12.198359Z

Are there any examples of using shadow with nodejs and worker_threads?

thheller 2025-04-29T08:27:03.309399Z

ok wild. just tried translating the node worker_threads example from their docs using "AI". the result is comically bad for all of the models. gemini is closest but still completely broken

thheller 2025-04-29T08:27:20.520429Z

maybe I'll create a proper example

john 2025-04-29T12:41:03.601519Z

Yeah the AI is not helping with this one

john 2025-04-29T12:41:09.278529Z

Appreciate it

john 2025-04-29T12:43:39.764349Z

I feel like I saw an example years ago that required enabling a certain kind of logging on the worker side, to be able to see outputs from the workers. But I could be imagining that

thheller 2025-04-29T05:53:54.466869Z

whats unclear about it? shadow is not involved in this. every node target can use this?

mkvlr 2025-04-28T06:42:57.028129Z

morning, we started seeing js syntax errors e.g. missing ) after argument list on our project. They randomly appear but only rarely, after ~hours of working. The only way we could make them go away was with a restart. One change we recently did was add a new :browser target in addition to our existing :esm target. Any ideas on things we should try next time it happens to find the root cause?

thheller 2025-04-28T06:43:41.955009Z

in what context does it appear? in what file? during what stage? I mean during compilation or at runtime in the browser?

mkvlr 2025-04-28T06:44:57.437739Z

only have a screenshot my colleague captured of the error last time

mkvlr 2025-04-28T06:45:31.276919Z

ah, I think I see the problem

mkvlr 2025-04-28T06:45:57.257729Z

our two targets are writing to the same :output-dir

🙂 1
mkvlr 2025-04-28T06:46:48.168499Z

that can cause problems I guess, especially if one is :browser and the other one is :esm and share some of the same source files?

thheller 2025-04-28T06:47:06.881299Z

yep 100%

thheller 2025-04-28T06:47:12.613989Z

would have been my first guess 😉

thheller 2025-04-28T06:47:58.131629Z

2 builds writing the same file at the same time will cause this. gotta hit the perfect timing though, which explains the randomly/rarely

🙌 1
mkvlr 2025-04-28T06:48:36.279569Z

ok, good. Thank you!