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
3
votes
2 answers

Error while mapping the sanity schema in my react webiste

I am trying to map a sanity schema, but I am unable to do so, please help me if any knows: This is the sanity schema categories.js which I want to traverse, here I want to traverse the features array of image type which contains array of…
Yashwant
  • 33
  • 4
3
votes
0 answers

Getting fetch error when deploying Nextjs / TS app to Vercel

Im getting this error when I try to deploy an app using Nextjs / TS / Sanity to Vercel 18:39:44.458] Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error [18:39:44.458] TypeError: fetch…
Endugu
  • 31
  • 2
3
votes
0 answers

Server Error: Unknown block type "code", please specify a serializer for it in the `serializers.types` prop

I am building a blog website using Sanity and NextJS. and facing error like: Server Error Error: Unknown block type "code", please specify a serializer for it in the serializers.types prop I've created this object in the sanity schema. { name:…
3
votes
0 answers

How to get sanity client on v3 scripts?

I didn't find a way to get client on Sanity v3 script. The old version was getting it from 'part:@sanity/base/client' and it doesn't work for v3. Well, it's simple: import { getCliClient } from 'sanity/cli'; const client =…
3
votes
1 answer

Vercel deployment: Error occurred prerendering page "/" TypeError: fetch failed

Yesterday I deployed my project (using Sanity.io) to Vercel and no issue. Today I edited my code and want to deploy the new version with this commands: vercel build vercel deploy --prebuilt vercel --prod The last command gave me an error…
Théo
  • 33
  • 4
3
votes
1 answer

It it possible to truncate text in a groq query?

I'd like to create an excerpt from a (portable) text field. Is this something that is possible? I know I can get the text value back using pt::text(body) and I can get values such as length from that. Is there any way to cut the text after n…
Designer023
  • 1,902
  • 1
  • 26
  • 43
3
votes
1 answer

Next.js - How to use getStaticProps to fetch Menu data and then pass it to the layout?

I am using Sanity.io as a backend, within Sanity I am handling the data for my main menu (parent/children object arrays). Whilst I can fetch this data just fine, I want to do so via getStaticProps, as I'd like my site to remain entirely statically…
richtea
  • 61
  • 4
3
votes
2 answers

Upstream dependency conflict, npm sanity/client

I'm trying to make a nextjs/sanity project at the moment, and I think I may have installed sanity client twice, but not entirely sure. This is the error I'm getting in the command terminal: npm ERR! code ERESOLVE npm ERR! ERESOLVE could not…
paparonnie
  • 170
  • 8
3
votes
1 answer

Error: Duplicated files or mocks. ReactNative-Expo-sanity.io

so have been developing a react native app using Expo and sanity.io as back-end, when I implemented sanity as backend i started getting an error just on the mobile versions(ios simulator, and andorid studio), but the web version is still working…
3
votes
1 answer

Error while connecting sanity content lake to frontend

I'm getting an error while fetching blogs from sanity to my template, I'm creating a next.js website Error: Error: Unknown block type "undefined", please specify a serializer for it in the serializers.types prop
3
votes
1 answer

Gatsby development server stops working when repo is created on github. Sanity, Gatsby Error

I received a github repo backup from somebody elses account. The project is running gatsby, sanity cms and is hosted via netlify. When I extract the archive and saving the folder locally, I am perfectly able to get the gatsby development server…
3
votes
2 answers

sanity start won't log me in

Did sanity upgrade -> npm install -> sanity init -> sanity start. I was given localhost:3333 link. Was able to try either Google or Github when logging in but it just goes back to login screen with choices every after selecting the user. However, on…
kev
  • 555
  • 1
  • 3
  • 14
3
votes
0 answers

TypeError: url.parse is not a function (fetching data from sanity.io)

I have been stuck on this thing for a week now. I am trying to fetch data from Sanity (http://sanity.io/) within a Vue (Vite) project, doing it exactly as this guide is showing:…
Blastius
  • 63
  • 1
  • 6
3
votes
7 answers

Error when I try to execute 'sanity start' after success with 'sanity init'

I am trying to install the Sanity studio and I followed these steps: npm install --global @sanity/cli sanity install sanity init After the init step, I try to run the next step: sanity start but it says: Run the command again within a Sanity project…
Varun S
  • 587
  • 4
  • 12
  • 25
3
votes
2 answers

How to get just the most recent of all documents

In sanity studio you get a nice list of the most recent version of all your documents. If there is a draft you get that, if not, you get the published one. I need the same list for a few filters and scripts. The following groq does the job but is…
cfm
  • 156
  • 1
  • 2
  • 12
1 2
3
55 56