Errors after upgrading Sanity from 3.15.1 to 3.16.0 with @sanity/vision

10 replies
Last updated: Aug 30, 2023
So I just upgraded
sanity
from 3.15.1 to 3.16.0 along with
<@UFY5PJF3M>/vision
from 3.15.1 to 3.16.0. However, I am not getting errors in my studio for things that used to work on
3.15.1
. I will put the desk structure entries for these in the thread.
AI Update

I understand the frustration of getting errors after upgrading! While I don't have access to the specific desk structure entries you mentioned in the thread, I can help you troubleshoot common issues that occur when upgrading from Sanity 3.15.1 to 3.16.0.

Based on the 3.16.0 release notes, this version focused mainly on Portable Text improvements, Unicode support, and bugfixes. However, there was one notable bugfix that might be relevant:

Key bugfix in 3.16.0: "Fixed a bug that caused specifying apiVersion on documentList() and documentTypeList() to not work in the desk structure."

This means if your desk structure uses documentList() or documentTypeList() with an apiVersion parameter, the behavior changed in 3.16.0 - it now actually works as intended, whereas before it was being ignored.

Common troubleshooting steps:

  1. Check your apiVersion usage: If you're using apiVersion in your desk structure functions, the fix in 3.16.0 might now be enforcing it where it wasn't before.

  2. Clear your Studio cache: Sometimes upgrade issues are cache-related:

    rm -rf node_modules/.sanity
    npm run dev
  3. Check for TypeScript errors: If you're using TypeScript, run npm run build to see if there are type errors that might not show up in dev mode.

  4. Review import paths: Make sure your desk structure imports are correct for v3.

If you can share the specific error messages or the desk structure code that's failing, I'd be happy to provide more targeted help! The error messages usually give good clues about what's breaking.

Show original thread
10 replies
So the first error is coming from this
And the second error is coming from this
Ah I guess it's because of https://www.sanity.io/help/structure-api-version-required-for-custom-filter that was updated/published yesterday... You now need to specify an
.apiVersion()
That's a little annoying...
Sorry to hear that :( Did adding
apiVersion()
fix the issue for you?
Yea adding
.apiVersion()
helped but I wouldn't of known that unless I looked at the browser console
Thanks so much for confirming 👍
No problem! I didn’t see anything that stuck out to me in the release notes that it was required now either, thankfully the console warning had a link
We have raised this with the product team as well and we'll let you know if they decide to make any updates here. Thank you 🙇‍♂️
Should be fixed in v3.16.1 – thanks for reporting!

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Was this answer helpful?