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
1 answer

How to change the value of a sanity field

So i want to change the value of a specific field called "likes" Here is the schema: //... fields: [ { name: "likes", title: "Likes", type: "number", } ] I want to change the like count when a…
Dev-Siri
  • 592
  • 5
  • 22
0
votes
1 answer

sanityClient says Module '"c:/Users/USER/Documents/..."' has no exported member 'sanityClient'

I already installed npm i @sanity/client it still dosen't work I created export const sanityClient = createClient(config); in sanity.js import type { NextApiRequest, NextApiResponse } from 'next' import { sanityClient } from '../../sanity' import…
Owolabi Tobi
  • 9
  • 1
  • 3
0
votes
0 answers

New document not being created in Sanity

Hi I am a starter to sanity, and I was planning to use it as my CMS. I created a form that the client could enter the details. The enter data then could be sent over and saved in Sanity A brief on my project I am using Typescript, Next.js and…
Joshua Daniel
  • 33
  • 1
  • 8
0
votes
1 answer

Using sanity with next js: Client error "Must be an attribute or a string key"

I'm working with next-sanity for creating the client, but I keep getting the " Client error: Must be an attribute or a string key" error. This is my config: import { createClient, createImageUrlBuilder } from "next-sanity" const config = { …
Manuel Nelson
  • 137
  • 1
  • 1
  • 8
0
votes
1 answer

I have been having issues connecting my sanity schema to react program

Line 40:1: Assign object to a variable before exporting as module default import/no-anonymous-default-export Search for the keywords to learn more about each warning. To ignore, add // eslint-disable-next-line to the line before.
0
votes
2 answers

Error: Command "start" is not available outside of a Sanity project context

Run the command again within a Sanity project directory, where "@sanity/core" is installed as a dependency.
0
votes
1 answer

I am having issue with my image src in next.js

I am using Sanity image url in my project and I am getting this error in my console page that says next-dev.js?3515:25 Warning: Prop src did not…
0
votes
1 answer

Sanity documents not showing

Whenever i create a new document in sanity using 'createOrReplace'. It successfully creates the document, but however it doesn't show the newly created document in the home screen. Note: All the other documents i upload from Sanity Studio displays…
Dev-Siri
  • 592
  • 5
  • 22
0
votes
1 answer

How to post data to sanity cms

Hi I want to POST more data on my sanity project database. To add data to the server like we do in the sanity studio How can I do that?
Dev-Siri
  • 592
  • 5
  • 22
0
votes
3 answers

TypeError: Cannot read properties of undefined (reading 'map') React JS and Sanity

When I try to run the code it gives me this error= TypeError: Cannot read properties of undefined (reading 'map') I dont know how to solve this import React from 'react' import { Tweet } from '../typings' import TweetBox from './TweetBox' import…
0
votes
0 answers

Typing with sanity schema - "Cannot Read Property of Undefined ..."

I have the following sanity-schema.ts: export type Character = { _type: "character"; /** * Character Name — `string` * * */ words: "spokenWords"; /** * Spoken Words — `string` * * */ }; export type Book = { _type:…
rowen
  • 49
  • 6
0
votes
0 answers

React Native and Sanity Fetch Request Problems/Mistake?

I am trying to fetch data from a Sanity Database HTML link but eveything i try it does not work... I am trying not to use the sanity client but just the link itself (Http:....) import React, { useEffect, useState } from 'react'; import {…
Josef Pa
  • 39
  • 1
  • 8
0
votes
1 answer

getStaticPaths was added without a getStaticProps - typescript

I am creating a blog using nextJS, typescript and sanity CMS. I have created the homepage where the post shows perfectly. next I am fetching the blog post details when I click the post with their individual slug. This query fetch data perfectly when…
0
votes
2 answers

Error: Configuration must contain `projectId`

i am trying to connect the sanity backend to my nextjs front end project, although I have my id and token in my client.js file but I still face this error: Error: Configuration must contain projectId import sanityClient from…
Mahdi Ehssani
  • 53
  • 1
  • 5
0
votes
1 answer

error while running "sanity init" command in a Next.js project, failed at "Resolving dependencies"

I tried to run sanity init in a Next.js project and got the following error: Error message image:
JIGSAW
  • 3
  • 1
  • 4