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.
830
questions
0
votes
1
answer
25
views
Newly added blog page doesn't reflect in hosted NextJS Project
NextJs is used to render the blogs that are added on sanity.io
There was only one blog post on sanity and deployed NextJs on Vercel, hosted NextJs project rendered that single blog post, but when ...
0
votes
0
answers
13
views
Next.js app router + Sanity revalidateTag() issues
I’m trying to get next app router + revalidateTag() to work with Sanity but it’s either completely unpredictable or I totally misunderstood something.
I now spent 5 full days trying to make it work ...
0
votes
0
answers
30
views
Nextjs 13 'use client' components rendering on server anyway with sanity
I'm trying to setup simple Nextjs application with Sanity studio, where Sanity is appended to my Next application, and lives under the route like /admin.
The problem is that when I try to access my ...
0
votes
2
answers
45
views
+250
Bust cache after content change with Sanity?
I'm using Sanity as a CMS and Next JS as my frontend. I’d like my site to be able to handle a reasonable amount of traffic so I think I need some caching.
However if an editor makes a change to the ...
0
votes
0
answers
7
views
Tailwindcss interfering with Sanity's PortableText/react
I'm working on a project that uses Sanity CMS rich text, and PortableText that parses through the text so it renders with proper formatting (ie. bullet points, bolded text, etc).
Wanting to learn ...
1
vote
0
answers
21
views
Bi-directional relationship schemas in sanity
I'm working on a project where I have two types of schemas in Sanity: 'Member' and 'Project Group.' Each 'Member' schema references a 'Project Group,' and vice versa. What I'm looking for is a bi-...
0
votes
0
answers
9
views
Schema Config with Custom Input
So I am working on a multi-stage select input in Sanity.
{
name: 'home',
title: 'Home',
type: 'object',
fields: [
{
name: 'team',
title: 'Team',
...
0
votes
0
answers
11
views
API calls getting counted while hitting from local in sanity
I'm using sanity + nextjs13 and fetching data using next-sanity. But the API calls are being made to the hosted server, which is counting under the free limit of 10k. How to prevent this counting ...
0
votes
3
answers
90
views
next 13 server side function fetching stale data from the sanity v3
I am building a blog website using next 13 with sanity v3 at the backend. The data next 13 is fetching from the sanity is stale.
I have unpublished 1 documents from the sanity
document I, have ...
0
votes
0
answers
11
views
Nextjs and reactjs package.json error when deployinh on vercel. Any suggestions on how I should approach this problem?
Looks like I have a dependency compatibility problem or I have installed different versions of sanity/client. I have two package.json files. One is for frontend and other is for backend. Here's how ...
0
votes
0
answers
17
views
Cant fetch data from sanity using next.js
I have my client.js file:
import { createClient } from '@sanity/client';
import imageUrlBuilder from '@sanity/image-url';
export const client = createClient({
projectId: '********',
dataset: '...
0
votes
0
answers
25
views
Displaying an image from Sanity block content
I am not able to display images from Sanity's block content. My guess is that I am not retrieving all the data necessary from the 'body' field in my query:
import { groq } from "next-sanity";...
0
votes
0
answers
7
views
Can't restore document from version history on Sanity
I can't restore previous document version from the version history on Sanity without notifying anything.
I can remember I could restore the previous document version in the last month.
It was showing ...
-1
votes
0
answers
27
views
Sanity integration with node js
I want to integrate nodejs with sanity and in that I want to pass a custom component in schema of sanity but using nodejs don't use react or ejs or html.For example: I want to create input component ...
-1
votes
1
answer
20
views
I'm getting this error using React Native and Sanity: Unable to resolve "get-random-values-esm" from "sanity\node_modules\sanity\lib\index.js"
I'm using sanity and react-native with expo to create an app. but on the mobile devices I get the error using expo go.
i've tried deleting node_modules folder, and re-intstalling the node_models, i'...
0
votes
0
answers
17
views
Next.js + Sanity. Getting 404 error when using next/link or next/router
Getting 404 error when go to project page
router.js:250 GET http://localhost:3000/_next/data/development/en/projects/missing-middle.json?slug=missing-middle 404 (Not Found)
When reload project ...
0
votes
0
answers
19
views
NextJS Sanity - Reference and Array
I have created a two schemas (Product and Categories). The schemas are connected by Reference.
I get the following error message when I try to render "Product.Category". I am able to render ...
1
vote
0
answers
12
views
How to render inline SVG from sanity?
I'm trying to render an inline SVG from the .svg file uploaded to sanity. I have tried with both image and file fields but it doesn't seem to supply the inline code
Any ideas?
0
votes
0
answers
13
views
How to access and change source-code of sanity.studios?
I have joined a sanity.studio and I want to make changes to the modules and the structure of the contents. I have not developed the modules or the content, but I have full access to sanity.studio.
I ...
0
votes
0
answers
16
views
How can I fetch a data "streak" using GROQ in a Sanity data set?
I used Sanity.io to create a way to manually track details of a game that my brother and I are playing and I plan to create a leaderboard of our versus stats and significant milestones.
I'm a bit new ...
-1
votes
0
answers
13
views
How to make a POST request from Nuxt to Sanity CMS
I am new to working with Nuxt and sanity and have a question regarding post requests. The frontend of my application is build using Nuxt and for the backend I use sanity. I would like to make post ...
0
votes
0
answers
47
views
Internal Server Error ECONNREFUSED nextjs 13 app directory (localhost:3000)
im only pulling data from sanity via a api endpoint, but no matter what i try, it keeps randomly crashing. i tried different versions of node, same issue, different versions of nextjs also same issue.
...
0
votes
0
answers
23
views
How to resolve error: Could not identify Next.js version, ensure it is defined as a project dependency
I'm trying to deploy my project to vercel but getting this error:
Warning: Could not identify Next.js version, ensure it is defined as a project dependency.
Error: No Next.js version could be detected ...
0
votes
0
answers
17
views
PortableText in Sanity v3
I started using PortableText for sanity v3 and I am struggling to understand the components options.
From the documentation it is unclear to me what is the difference between block:{} and types:{} ? I ...
0
votes
0
answers
19
views
Trying to create dynamic pages - no display of content when clicking Link element with dynamic url in Next.js/sanity.io
I'm trying to create dynamic pages in Next.js 13 for each product that I'm fetching from sanity.io's backend. The URL changes by clicking on a ProductCard component but I keep on failing in displaying ...
0
votes
0
answers
27
views
Is it possible to have all your data in Sanity.io be stored locally instead of on the Content Lake
So I have a "simple" e-commerce next.js app that uses Sanity to manage the data. What I also have is an empty Alibaba server that I want to use to keep the data that is used in the app. My ...
0
votes
0
answers
13
views
Weird Sanity CMS / Nest.js bug
I've been pulling my hair out for a couple hours with this one. But basically I can't render a custom component in the React Portable Text component. I continue to get this error:
[@portabletext/...
0
votes
1
answer
68
views
The signature '(config: ClientConfig): SanityClient' of 'sanityClient' is deprecated
I am getting this when I try to use sanityClient.
The signature '(config: ClientConfig): SanityClient' of 'sanityClient' is deprecated.
Here is how my connection looks like
export const client = ...
-1
votes
1
answer
42
views
Displaying image from sanity in Vue (nuxt project)
i am new to sanity, i am struggling for displaying image from sanity
this is the code for my frontend
is this the problem?
<img :src="pet.image.asset" :alt="`image of ${pet.name} `&...
0
votes
0
answers
18
views
I am getting error of "TypeError: Cannot read properties of undefined (reading 'title')" while deploying my nextjs app
I'm using nextjs as framework trying to display my blogposts which are on sanity using slug. The sanity's schema I have chosen is of blog type and sanity is in typescript while nextjs app is in ...
0
votes
0
answers
11
views
The layout has suddenly stopped displaying correctly in a project that uses NextJS + Sanity + Tailwind. The error: dom.js failed
I am build my first page with NextJS + Sanity + Tailwind.
Everything worked well, but on some page refresh layout was destroyed.
I can't understand the reason, I did not do any braking changes.
Does ...
0
votes
0
answers
34
views
Why does my middleware file not trigger for every page in my nextjs app?
I'm struggling with my middleware file in my sanity next.js project. I use it to prefix language and redirect.
My src directory looks as follows:
> src
> app
> (studio)
> [lang]
...
0
votes
0
answers
95
views
Issue with revalidating Next.js and Sanity documents using a webhook
I'm working on a Next.js 13 project that uses Sanity as a CMS and is deployed on Vercel. I have set up a webhook to trigger revalidation of components and pages whenever a new testimonial is added, ...
1
vote
0
answers
25
views
Data is not updated after changes in the Sanity Studio
I am quite new to Sanity v3 + Next.js v13. Everything works great on my test site, but I have a problem when I update a document (project) or add a new one in the Sanity Studio – these changes are not ...
1
vote
1
answer
123
views
Next.js undici AbortError - how to debug?
I have a Next.js 13.4.13 site fetching data from Sanity.io with next-sanity. However, whenever I boot up two things are happening:
new updated data from Sanity is not being fetched
I'm getting a huge ...
0
votes
0
answers
158
views
Next.js 13.4.13 (app router) data revalidation randomly no longer working
I know it's not helpful, but I have no idea why or what has changed to stop my revalidation. I have a sanity.io + next.js project where I am using GROQ to call and fetch new data, which has been ...
0
votes
0
answers
20
views
Sanity: Validate Array items using native Sanity URL validations
I'm creating a Sanity schema for a list of organisations which we will be importing over. I have a field called domains which is an array of domains linked to an organisation. None of these domains ...
0
votes
0
answers
8
views
sanity start command is running but showing following error
Getting error while doing sanity start: Module not found: Error: Part "sanity:css-custom-properties" not implemented by any plugins
what should I do to resolve this?
I tried installing ...
0
votes
1
answer
50
views
Sanity environment variable
Hi I am currently trying to set a sanity environment variable in the sanity folder.
According to the sanity documentation, it says to use process.env.SANITY_STUDIO_VARIABLE_NAME but looks like it ...
0
votes
0
answers
31
views
I am unable to add latex into my blog in sanity.io
I recently started web development using next.js and sanity.io. I want to use latex plug-in of sanity.io but I am not quite sure how to do that. I am sending the link of my github so please if anyone ...
1
vote
0
answers
221
views
Next.js 13 'TypeError: fetch failed' while trying to render static pages using getStaticProps. Need help fixing code
Can someone please help me with this? I'm new to APIs and am having a hard time figuring this out for the last few days. I'm using Sanity for my backend.
This is the error I get in the terminal: -
- ...
-1
votes
1
answer
18
views
Facing this issue when initalizing sanity in vscode for my react app
npm ERR! code ERR_SOCKET_TIMEOUT
npm ERR! errno ERR_SOCKET_TIMEOUT
npm ERR! network Invalid response body while trying to fetch https://registry.npmjs.org/babel-p at makeError$1 (C:/Users/Shoaib/...
1
vote
0
answers
42
views
Sanity Client - TypeError: Object is not a function in defineHttpRequest
I'm trying to setup a connection with Sanity with my local build, however I'm getting the following error when configuring my client.js file.
TypeError: Object is not a function. (In 'Object(...
0
votes
0
answers
15
views
How To Access Sanity Desk
I just finished my React app using sanity as the backend. I deployed the app and it's working fine but whenever I want to add data to the database I find myself accessing the database through the ...
0
votes
0
answers
38
views
Can't fetch data from Sanity to next.js
I'm currently learning Next.js and have gone through one blog tutorial with the Sanity plug-in. But I get an error and I can't figure out why(
Screenthot of the error message
Here is the error that is ...
0
votes
0
answers
15
views
Having asset issue invalid _type 'image' in Sanity, when trying to name it different
Mates.
I am stuck in a very serious problem and need guidance.
I created a schema
export default {
title: 'Blog Content',
name: 'blogContent',
type: 'object',
fields: [
{
title: 'Title',
...
0
votes
0
answers
150
views
PortableText Typescript Error with Sanity.Io in Nextjs Application
I am upgrading my NextJs/Sanity application to NextJS 13 using Sanity.io and typescript.
The PortableText tag no longer works. The value and components attributes are flagged as an error in Visual ...
0
votes
1
answer
16
views
Typescript - How to extract values from Sanity API Result - JSON
I am trying to get the values from a Sanity Client API call and can't figure out how to get the values from resulting JSON.
Here is the result of the api call:
[
{
slug: { current: "test-...
0
votes
0
answers
51
views
Im getting an "The default export of @sanity/client has been deprecated. Use the named export createClient instead" warning. What is the problem?
I am trying to implement sanity into an existing project built with astro. I have followed this tutorial - step by step, https://www.sanity.io/guides/sanity-astro-blog
I'm not sure what the issue is ...
0
votes
0
answers
20
views
Sanity.io - How to add locations in URL slug?
I have a location schema and a main schema. 'location' has multiple field and I want to choose one of those fields and add it into the URL of the main schema. Is this possible?
{
name: 'location',
...