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
0
votes
0 answers

How to upload images from Next.js to Sanity

I have been working on a project using next.js and sanity but I can't seem to find a way to upload images to Sanity. I have been following the Sanity tutorial on how to upload assets and it works only if I set the filepath manually or if the assets…
Ameiz
  • 646
  • 3
  • 9
0
votes
1 answer

How to solve Sanity warning: You have configured Sanity client to use a token in the browser

I'm using ReactJS for the front-end and Sanity for the back-end. I came across this warning and I have read this linked documentation but I'm not sure how to apply in this case. I'm sure that I don't want to ignore the warning if it's for security…
KYin
  • 439
  • 1
  • 5
  • 21
0
votes
0 answers

Next.js - api call returns error 500 when trying to delete a comment on Click

I have two files inside mine /api/ folder. create-comment.tsx and delete-comment.tsx the create comment works perfectly fine. with method "POST" but using method "DELETE" to remove a single item from the back-end returns in: DELETE…
Galanthus
  • 1,958
  • 3
  • 14
  • 35
0
votes
1 answer

Sanity CMS custom sorting

I don’t know if exists some way to sorting the results by custom field. My query: *[_type == "movies" && actors] { ..., isHarryMovie: name match "Harry*" } So I want to sort the results by isHarry, is it posible? I tried something like…
0
votes
2 answers

Super Basic Sanity Schema Import

I need some help importing schemas from Visual Studio Code into the Sanity console. I'm importing everything as usual and when Content Studio is successfully compiled I'm still not seeing anything in the Studio I see Empty Schema every single time.…
0
votes
0 answers

API Endpoint results to a validationError "Document type is missing in document" in Next.js app

I'm using Sanity studio API to send information back and forth to my next.js app. When I hit the url API endpoint in the browser it gives me this: {"message":"Couldn't submit comment","err":{"response":{"body":{"error":{"description":"the…
azoth820
  • 13
  • 5
0
votes
0 answers

Next JS server side rendering on Index.tsx with NextPage componet

tsx file having a Home component below it there is getServerSiderProps method.i want to get server side but props inside my Home component show undefined. import type { NextPage } from 'next' import Head from 'next/head' import Banner from…
user18685664
0
votes
1 answer

Why isn't getStaticPaths working with groq and sanity

i am trying to make this work and it just won't -- Dev hell... I am trying to use next js and sanity io together and i am having no luck. If anyone can point me in the right direction i will be so happy. I have tried many different ways in subject…
Tjs90
  • 61
  • 1
  • 10
0
votes
1 answer

Encountering Unhandled error in Sanity on localhost

TypeError: Cannot read properties of null (reading 'jsonType') at validateNonObjectFieldsProp (/static/js/app.bundle.js:169457:16) at _default (/static/js/app.bundle.js:169425:155) at visitors.reduce._objectSpread._problems…
0
votes
1 answer

How to query Sanity client with NestJS?

Right now I have React app initialized with Vite connected with Sanity. Everything is working just fine, Sanity client is connected, React is fetching data from Sanity, I'm receiving it with no problem. But the problem is, that if I deploy React…
BlackH3art
  • 436
  • 1
  • 7
  • 15
0
votes
0 answers

Node module not found

I am this error when i am trying to run the sanity.io in node. node:internal/modules/cjs/loader:933 const err = new Error(message); ^ Error: Cannot find module 'dotenv' Require stack: - D:\APIs\node_modules\@sanity\cli\lib\cli.js …
Ayush
  • 49
  • 2
  • 9
0
votes
1 answer

Scheduled posts not showing in Sanity calendar

I installed Sanity Content Calendar using sanity install content-calendar. Under Desk tab, scheduling works as the Publish button becomes a Schedule button but once I schedule a post, nothing seems to show up under Calendar tab and the calendar is…
Quentin C
  • 307
  • 3
  • 13
0
votes
1 answer

TypeError: Cannot destructure property 'siteSettingsData' of 'data' as it is undefined

TypeError: Cannot destructure property 'siteSettingsData' of 'data' as it is undefined. Give this error when I'm going to pass data from a component but work fine on index page import React from 'react' import client from '../lib/sanity'; …
raqibnur
  • 59
  • 1
  • 7
0
votes
3 answers

why does adding sanity to my react frontend blank the whole localhost:3000 out?

I have my code set up like this with two folders one backend_sanity and the other frontend_react and i can not get the sanity to link to my react front end without blanking the entire webpage on localhost:3000. I have tried re coding everything…
Jlooker97
  • 1
  • 1
0
votes
1 answer

Attempting to use 'sanity start' CLI results in 'command not found'

npm install -g @sanity/cli sanity init $ sanity start bash: sanity: command not found How can i solve it?