cherry

opqdonut 2025-05-12T13:06:09.358249Z

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
borkdude 2025-05-12T13:06:32.632019Z

Same malli version?

opqdonut 2025-05-12T13:06:44.650439Z

see also: https://github.com/metosin/malli/pull/1201

opqdonut 2025-05-12T13:07:02.408139Z

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

borkdude 2025-05-12T13:07:18.845699Z

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

opqdonut 2025-05-12T13:07:53.354739Z

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

borkdude 2025-05-12T13:08:12.389699Z

not yet known. narrowing it down would be sweet!

opqdonut 2025-05-12T13:08:18.356779Z

I'll see what I can do

opqdonut 2025-05-12T13:26:36.533439Z

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

opqdonut 2025-05-12T13:27:04.947389Z

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...

borkdude 2025-05-12T13:30:41.813109Z

cherry uses SCI for executing macros

borkdude 2025-05-12T13:31:10.034189Z

does malli run with the previous version of cherry?

opqdonut 2025-05-12T13:31:14.798439Z

yep

opqdonut 2025-05-12T13:31:43.762979Z

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)

borkdude 2025-05-12T13:32:19.017039Z

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

opqdonut 2025-05-12T13:32:28.112159Z

right of course

borkdude 2025-05-12T13:32:44.867999Z

I can have a look but not today or tomorrow

opqdonut 2025-05-12T13:33:13.064459Z

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!

borkdude 2025-05-12T13:33:38.016809Z

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
opqdonut 2025-05-12T13:36:25.500239Z

https://github.com/squint-cljs/cherry/issues/154

🙏 1
borkdude 2025-05-12T18:53:44.059569Z

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

borkdude 2025-05-12T18:57:33.566529Z

https://github.com/metosin/malli/pull/1202

🙌 1