745 questions
Best practices
0
votes
0
replies
46
views
Sanity Typegen doesn't resolve dynamic language mapping in GROQ
I am using sanity typegen with Next.js and I have localized fields in my Sanity schema. In my GROQ queries, I use a $lang variable to pick the correct translation. While the query works perfectly at ...
0
votes
0
answers
34
views
Sanity IO error when trying to visit /studio on localhost
I just setup Sanity within my project, everything is default and I've added the env variables: NEXT_PUBLIC_SANITY_PROJECT_ID and NEXT_PUBLIC_SANITY_DATASET, which I made sure they correspond to the ...
0
votes
1
answer
100
views
Clerk + Sanity integration issue w/ Next.js
Using Next.js (15.2.4), Clerk Auth, and trying to integrate Sanity as a CMS into the application. After installing Sanity and hitting /studio, this error appears:
Error: Clerk: auth() was called, but ...
2
votes
0
answers
56
views
How do I get proper type hinting for input component in Sanity Studio?
As the title suggests, I'm making a custom Input component for example, for a object of type productFilters, like:
import { defineType, defineField } from "sanity"
import { ...
0
votes
1
answer
82
views
How to expand the width of the post in the Sanity Studio structure tab?
How to expand the width of the post in the Sanity Studio structure tab, like pictured below? Github copilot is suggesting adding views([S.view.form().options({width: 'full'})]) but options isn't a ...
0
votes
0
answers
56
views
Sanity Studio: Failed to resolve import @/*
I use sanity cms studio and i have defined paths @ for src folder but I'm getting [plugin:vite:import-analysis] failed to resolve import
I have defined the alias in both typescript and sanity cli
...
0
votes
0
answers
26
views
Sanity RichTextEditor for block content is disabled and cursor pointer always moves to the left most on every type
I have implementing blockcontent for post and the text editor is disabled. Tried degrading the sanity and react version but nothing helped.
Disabled TextEditor
Below is the BlockContent type in sanity ...
0
votes
1
answer
156
views
Sanity query Filter Post by Categories
I'm new using Sanity and I'm trying to filter my sanity studio posts by category, I've been looking for answers and trying different queries, but this is the only one that has worked
`
*[_type == &...
0
votes
0
answers
291
views
Export next.js site statically
I have a simple restaurant website that uses next.js and sanity.io client to fetch the data. I want to export it statically (to html+css+js files) so that I won't need to use a container (or Vercel) ...
0
votes
1
answer
174
views
How to display Portable Text block content images in SvelteKit
I'm trying to render a blog post from Sanity Studio in my SvelteKit project.
Currently, all of the text etc is being displayed, but images within the block content aren't. Below is what I have tried ...
0
votes
0
answers
57
views
Sanity.io: Unable to resolve image URL from source (undefined)
I was fetching my images in cart page. I wanted just 1 image so my code is below if you guys help me out my pleasure.
import { urlFor } from "@/sanity/lib/image";
import ...
0
votes
1
answer
122
views
Sanity Blog fetching worked on local but failed on Cloudflare production
UPDATE:
The problem is solved! I have tried using NextJS version 15.1.6 with next-sanity version 9.9.0, also don't use any API calls with export const runtime = 'edge'
If there are problems with your ...
0
votes
1
answer
107
views
Profile and account undefined inside jwt callback function for next-auth
I'm having an issue defining my jwt callback.
I have this auth.ts file
import NextAuth, { Profile, User, Account, Session } from "next-auth";
import { JWT } from "next-auth/jwt"
...
0
votes
1
answer
91
views
Not able to access value, _value or _rawValue fields of a RefImpl from a sanity query in nuxt typescript
I define my sanity query like this. I inspected the network tab, and the response was correct. The first object printed is a RefImpl. It contains the correct values when I inspect it in the console. ...
1
vote
0
answers
33
views
Issue displaying content from Sanity cms
I have a react website that's connected to Sanity for a CMS. Locally, everything works fine and the content loads in. When I run a build and upload to godaddy, the Sanity content isn't displaying.
...