This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-29
Channels
- # babashka (168)
- # beginners (60)
- # calva (21)
- # cider (44)
- # clj-kondo (27)
- # cljs-dev (4)
- # cljsrn (2)
- # clojure (157)
- # clojure-australia (27)
- # clojure-bay-area (7)
- # clojure-czech (1)
- # clojure-europe (94)
- # clojure-nl (2)
- # clojure-spec (3)
- # clojure-sweden (11)
- # clojure-uk (35)
- # clojurescript (19)
- # cursive (12)
- # events (1)
- # figwheel-main (1)
- # fulcro (28)
- # honeysql (7)
- # jackdaw (9)
- # kaocha (4)
- # keechma (1)
- # malli (7)
- # midje (1)
- # missionary (1)
- # music (1)
- # off-topic (45)
- # pathom (18)
- # polylith (6)
- # practicalli (4)
- # random (1)
- # reagent (3)
- # reitit (3)
- # shadow-cljs (74)
- # sql (9)
Running
cljs.spec.test.alpha/instrument
then cljs.spec.test.alpha/check
on fns w/ a namespaced keyword is producing the error: RangeError: Maximum call stack size exceeded
. This seems like a bug in Clojurescript.
https://clojure.atlassian.net/browse/CLJS-3023
https://clojure.atlassian.net/browse/CLJS-2995
But maybe I’m doing something wrong? I’ve tried on these lib pairs.
org.clojure/clojure {:mvn/version "1.10.3"}
org.clojure/clojurescript {:mvn/version "1.10.844"}
org.clojure/clojure {:mvn/version "1.9.0"}
org.clojure/clojurescript {:mvn/version "1.10.339"}
a.cljs
(s/fdef github-deployment->deployment
:args (s/cat :message (s/keys :req [::github.deployment/payload])))
(defn github-deployment->deployment [{payload ::github.deployment/payload :as message}]
)
(cljs.spec.test.alpha/instrument)
b.cljs
(cljs.spec.test.alpha/check
`backend.topology.processor.transform.deployment/github-deployment->deployment
{:clojure.spec.test.check/opts {:num-tests 1}})
[{:spec #object[cljs.spec.alpha.t_cljs$spec$alpha20390], :clojure.test.check/ret {:result #object[RangeError RangeError: Maximum call stack size exceeded]}, :sym backend.topology.processor.transform.deployment/github-deployment->deployment, :failure #object[RangeError RangeError: Maximum call stack size exceeded]}]
I doubt I can help you solve this, but I assume you've verified that the generator for ::github.deployment/payload
works and produces values without encountering that call stack issue?
No, that’s a great suggestion. I did check that, and I was generating the spec in question.
I did find the problem though. A given namespace has to handle messages, all keyed by a :payload
entry. When I put a namespace on it… and place it in a file with other specs, it turned out that there was a separate :payload
somewhere in the spec tree.