cherry 2025-05-12

Regression in malli when upgrading from cherry 0.4.26 to 0.4.27. Lots of errors like

#object[TypeError TypeError: self__.s.charAt is not a function]
Does this sound familiar?

✅ 1

Same malli version?

yeah this is in the malli test suite, I'm in the progress of bumping malli's deps

Please file an issue, I'll take a look at it soon-ish

I'll try to narrow it down a bit first, opened this thread in case this was a known problem

not yet known. narrowing it down would be sweet!

I'll see what I can do

the thing that's actually throwing those errors seems to be sci.core – weird

sci doesn't use cherry, right? I'm wondering if something is clobbering the methods of String when we load it or something like that...

cherry uses SCI for executing macros

does malli run with the previous version of cherry?

managed to extract an actual stacktrace – doesn't mention cherry or sci 🤔

Error: No protocol method ICounted.-count defined for type cljs.core/Symbol: inc
    at Object.cljs$core$missing_protocol [as missing_protocol] (/home/joel/work/metosin/malli/cljs-test-runner-out/cljs/core.cljs:324:3)
    at cljs$core$ICounted$_count$dyn_11643 (/home/joel/work/metosin/malli/cljs-test-runner-out/cljs/core.cljs:589:1)
    at Object.cljs$core$_count [as _count] (/home/joel/work/metosin/malli/cljs-test-runner-out/cljs/core.cljs:589:1)
    at cljs$core$count (/home/joel/work/metosin/malli/cljs-test-runner-out/cljs/core.cljs:1881:14)
    at cljs$tools$reader$reader_types$string_reader (/home/joel/work/metosin/malli/cljs-test-runner-out/cljs/tools/reader/reader_types.cljs:215:23)
    at Function.cljs$core$IFn$_invoke$arity$2 (/home/joel/work/metosin/malli/cljs-test-runner-out/cljs/tools/reader/reader_types.cljs:222:23)
    at cljs$tools$reader$reader_types$string_push_back_reader (/home/joel/work/metosin/malli/cljs-test-runner-out/cljs/tools/reader/reader_types.cljs:217:1)
    at Function.cljs$core$IFn$_invoke$arity$1 (/home/joel/work/metosin/malli/cljs-test-runner-out/cljs/tools/reader/reader_types.cljs:220:7)
    at cljs$tools$reader$reader_types$string_push_back_reader (/home/joel/work/metosin/malli/cljs-test-runner-out/cljs/tools/reader/reader_types.cljs:217:1)
    at edamame$impl$parser$string_reader (/home/joel/work/metosin/malli/cljs-test-runner-out/edamame/impl/parser.cljc:826:4)

the fact that it doesn't mention cherry or SCI could just mean that it's compiled using cherry and then executed using whatever. compiled code doesn't need cherry anymore

right of course

I can have a look but not today or tomorrow

I'll create an issue for cherry. I also need to stop looking at this right now, but will try to narrow it down further tomorrow. Thanks!

the last time I looked at an issue like this with malli + cherry I inserted some printlns somewhere to debug the code that cherry emits before evaluating it

👀 1

Fixed: https://github.com/squint-cljs/cherry: Experimental ClojureScript to ES6 module compiler 0.4.28 (2025-05-12) • Fix https://github.com/squint-cljs/cherry/issues/154: cherry.embed/eval-form