👀 Our most exciting product launch yet 🚀 Join us May 8th for Sanity Connect

Issue with missing data in responses from the Sanity Client in Next.js 14 codebase.

8 replies
Last updated: Feb 14, 2024
Since yesterday/today, we at MR MARVIS are having some issues with the responses from the Sanity Client (in our Next.js 14 codebase). Randomly, data seems to be missing from the response.
See the attachment for instance. The left side works, and the highlighted information is present. On the right side (which was generated 5 seconds later by refreshing the page), the media information is missing.
Feb 13, 2024, 4:54 PM
👋 Can you share more information about your build and how you’re querying this data?
Feb 13, 2024, 5:11 PM
Also, since it’s difficult to read that screen shot, can you paste just the expected output vs the output you get here? You can simplify it to just the missing information.
Feb 13, 2024, 5:17 PM
• useCdn true/false doesn't differ• Next.js 14 / Node 20 (also breaks on Node 18)
• Sanity client (
sanity@3.28.0
)
Feb 13, 2024, 5:26 PM
We've created a query URL, you can clearly see the randomness in responses if you refresh this page a couple of times


https://yb9xf4jc.api.sanity.io/v2022-03-07/data/query/production?query=*%5B_type+in+%5B%[…]A++++%7D%2C%0A++++%7D%0A++%7D%0A%7D&perspective=published
Feb 13, 2024, 5:27 PM
Every 5-10 refreshes we have the difference in response.
Feb 13, 2024, 5:27 PM
Thank you!
Feb 13, 2024, 5:33 PM
We were able to reproduce this and have found the cause. A change was rolled out to our backend that effected the way references were resolved. It has been reverted and you should no longer experience it. I apologize that you experienced it!
Feb 13, 2024, 5:54 PM
Thank you!
Feb 14, 2024, 7:29 AM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?