Questions tagged [sanity]

Sanity is a structured content platform and API that also offers an open source, React-based Studio that functions as like a headless CMS on top of the Sanity APIs.

Sanity treats content as structured data and makes it easily available over an API. The collaborative editor, called the Content Studio, is a fully customizable, client-side web application. Documentation here.

833 questions
2
votes
2 answers

How to remove a specific document from sanity desk structure?

I added the media library plugin to my sanity structure builder but want to remove the 'media tag' document that gets created by the plugin However, you can override this behaviour by defining your own custom desk with Sanity's structure builder…
Burger Sasha
  • 187
  • 6
  • 17
2
votes
0 answers

Next.js 13 with sanity studio unexpected behaviour with layouts

I am trying to make a bloglike application using next.js 13 and sanity for the CMS. I have created a navbar that I would like to only show on the standard page but not on the stanity studio page. The app looks as it should on initial load, however,…
Mark Scholes
  • 75
  • 2
  • 6
2
votes
1 answer

Why NextJS give me this hydrating error after refreshing the page?

When I refresh my page I got these erorrs : Text content does not match server-rendered HTML. Hydration failed because the initial UI does not match what was rendered on the server. There was an error while hydrating. Because the error happened…
Pickez
  • 45
  • 1
  • 6
2
votes
1 answer

Module '"sanity"' has no exported member 'defineConfig'

I've just finished working on a project using Next.js 13 and Sanity as a headless CMS. Here is the issue I'm experiencing: When I run vercel build I get the error that 'sanity' has no exported member 'defineConfig' and this is coming from the…
Olowoseun
  • 21
  • 1
2
votes
0 answers

Uncaught TypeError: Method Promise.prototype.then called on incompatible receiver # at Proxy.then ()

Been trying to fix this for a while and it's becoming quite annoying, help would be really appreciated. Context using sanity.io cms and I think the error may come from client.js, where the client is created to fetch data from sanity.io using…
Joe Matkin
  • 21
  • 3
2
votes
3 answers

Problem Deploying a Next JS + Sanity Project to Vercel

I was on a project and used nextjs with sanity but after almost finishing my project, I just don't see any way to deploy it. Learning sanity took quite a bit of time but what meaning is there if I can't use it anywhere. I installed vercel and ran…
2
votes
2 answers

Vercel, Next.js, Sanity.io production deployment fails

I have a Next.js + Sanity.io project and when I deploy from local build using vercel CLI with vercel build and then vercel deploy --prebuilt, it works great. However, when I do vercel --prod to create production deployment, it keeps failing. The log…
JL.
  • 21
  • 3
2
votes
3 answers

I am building a React Application using the Sanity CMS for the backend but I am running into a client error when sending data to the backend

I am building a react application and using a Sanity CMS for the backend but I am running into an issue whenever I try to load data into the backend from the client. Everything else works perfectly fine until a website visitor tries to send data…
2
votes
1 answer

Sanity Query Does Not Return Updated Data Consistently

I have a "film" category in my Sanity database which has an array of comments. In my UI, I present a pic of the film with the comments listed below the film. I created a function to add comments to the film and then fetch the film with the…
Scott F.
  • 71
  • 8
2
votes
0 answers

Object object being displayed when trying to render blockContent on React

I am working on a website and trying to render a blockContent from Sanity.io, in my React application, but it's displayed as only [object Object] on the website. I tried different queries on Sanity Vision, and got the data but nothing seems to work,…
Sanjay G.
  • 47
  • 9
2
votes
0 answers

How can I display objects based on which selection on Sanity

I am trying to display objects based on two options, isLinear or isHex when one of these is selected then I will display the corresponding object on Sanity. if isLinear is selected then I display the degree, the color hex, the percentage inputs…
Jaacoubi
  • 31
  • 2
2
votes
0 answers

Cannot read properties of undefined (reading 'length') Lottie React

I get an undefined issue while trying to set lotties using lottie-react I am setting CDN link instead of just importing it directly . This is the code : {missions.map((mission : any) => (
2
votes
1 answer

Next Js Api routes response helpers (redirect)

I'M trying to create a login functionality in Next js. Everything is pretty much done but I'm unable to redirect to homepage after login. I'm using Next js with sanity as headless CMS This is my login api export default async function…
NexCodes
  • 149
  • 6
2
votes
3 answers

Module not found: Can't resolve '@sanity/client'

I keep getting this error on localhost Failed to compile ./lib/client.js:1:0 Module not found: Can't resolve '@sanity/client' > 1 | import sanityClient from '@sanity/client'; 2 | import imageUrlBuilder from '@sanity/image-url'; 3 | 4 | export const…
DiwSlow
  • 21
  • 1
  • 2
2
votes
1 answer

Uncaught TypeError: (0 , _sanity_client__WEBPACK_IMPORTED_MODULE_0__.sanityClient) is not a function

I'm trying to fetch data from Sanity into my react app for the first time. At the moment, I'm trying something small, so I have a schema called website_images, that has an image type called about and a separate string for alt. In the tutorial video…
paparonnie
  • 170
  • 8