Search code examples
next.jssanity

"param $slug referenced, but not provided"


when I try to fetch data inside sanity vision, I get this error:

param $slug referenced, but not provided
*[_type == "post" && slug.current == $slug][0]{
-------------------------------------^^^^
Line:   0
Column: 37

this is the SS of the sanity vision


Solution

  • In the PARAMS panel in the bottom-left, you’ll want to specify a slug param.

    {
      “slug”: “some-slug”
    }