I'm getting a java.lang.IllegalArgumentException: No value supplied for key: in my Clojure code.
I know this is what happens when I'm trying to destructure the keys in a mapping passed as an argument.
However, what's odd here is that this function has been working fine for ages, with the same data. And the only thing that seems to be different is how I'm now importing the function
Here's the error:
Caused by: java.lang.IllegalArgumentException: No value supplied for key:
{:style {:color [255 150 150 255], :stroke-weight 2}, :points [[-1 0] [0 -1] [1 0] [0 1] [-1 0]]}
And here's the function that threw it.
(defn scale
[val {:keys [style points]}]
{:style style
:points (scale-shape val points)})
In other words, I'm asking for the map to contain keys called style and points and it's being given a map which contains keys called style and points.
And this code has been working fine for months.
The difference is that I'm now calling it using sshapes/scale where sshapes was imported with:
(:require [patterning.sshapes :as sshapes])
whereas previously I was just calling it as scale where scale came into the namespace using
(:require [patterning.sshapes :refer :all])
Could this cause that kind of error?
scale-shapes?) Now that this other function not being pulled in, maybe you're using a function of the same name from a different namespace, and it's not generating something in the format thatsshapes/scaleexpects. - Marsscale. Please include the relevant code or at least a full stacktrace, if you need help debugging an error message. - amalloy