shadow-cljs

thheller 2025-05-01T07:21:11.894379Z

I didn't make any changes moving from 11 to 24, so should be easy to move 😉

thheller 2025-05-01T07:21:26.278939Z

not like 8->11, which wasn't hard either to be fair, just broke a lot of stuff

thheller 2025-05-01T07:41:15.624119Z

just released 3.0.4 with a new cljs version because of a bug in cljs. consider updating if you are on 3.x

lilactown 2025-05-01T04:46:14.092979Z

I seem to have found a bug with the :karma build target reporting failures when nil is passed to is. Repro: https://github.com/lilactown/is-nil-bug Essential details:

(ns town.lilac.is-nil-test
  (:require
    [cljs.test :refer [deftest is]]))


(deftest is-nil
  (is nil))
when run with shadow-cljs compile test && npx karma start --single-run results in
TypeError: Cannot read properties of null (reading 'hasOwnProperty')
      at shadow$test$karma$format_log (ci.js:63192:41)
      at ci.js:25451:89
      at ci.js:25452:3
      at Object.sval (ci.js:19297:110)
      at Object.cljs$core$ISeqable$_seq$arity$1 (ci.js:19448:10)
      at Object.cljs$core$seq [as seq] (ci.js:12341:13)
      at ci.js:25425:36
      at Object.sval (ci.js:19297:110)
      at Object.cljs$core$ISeqable$_seq$arity$1 (ci.js:19448:10)
      at Object.cljs$core$seq [as seq] (ci.js:12341:13)

thheller 2025-05-01T07:15:54.707469Z

does that still happen if you have

(deftest is-nil
  (is (produces-nil))

thheller 2025-05-01T07:16:15.005049Z

I mean its kinda weird to have (is nil)?

thheller 2025-05-01T07:17:21.456229Z

since I'm not going to make any more 2.28 releases, you can take this file https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/test/karma.cljs and put it on your own classpath

👍🏻 1
thheller 2025-05-01T07:17:37.737259Z

modify it however you need. it'll be used over the version in shadow-cljs

thheller 2025-05-01T07:17:52.769719Z

thats the problem I guess

lilactown 2025-05-01T16:20:27.323979Z

yes, I tried to give a minimal example but you can do (is (:x {})) and it produces the same error

lilactown 2025-05-01T16:33:47.048689Z

Is there a way to configure the ns that the :karma build uses to start?

lilactown 2025-05-01T16:34:05.327249Z

oh probably in the karma.conf.js

lilactown 2025-05-01T16:34:56.039479Z

ah but it isn't compiled automatically

thheller 2025-05-01T18:18:05.342769Z

:runner-ns in the build config, shadow never looks at karma.conf.js

lilactown 2025-05-01T19:20:28.446719Z

right, I think updating both those places fixed it!

lilactown 2025-05-01T19:20:47.736969Z

FYI I just changed the line to

(and (some? actual) (.hasOwnProperty actual "stack"))

lilactown 2025-05-01T04:47:14.393289Z

For some reason in our main app repo, the test runner hangs until it disconnects. Here it seems to fail with an error. My hunch is it's related. Note: I'm stuck on 2.28 until we can upgrade our Java beyond version 11