All Questions

Tagged with
Filter by
Sorted by
Tagged with
4 votes
4 answers
4k views

Uncaught Error: Configuration must contain `projectId`( when using environment variable )

Only when using an environment variable for projectId inside sanityClient, it can't find it even though is inside the .env file My goal is to connect backend data from Sanity to my frontend in ...
kebron solomon zerie's user avatar
3 votes
0 answers
1k views

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: https://www.sanity.io/...
Blastius's user avatar
2 votes
3 answers
4k views

Module not found: Can't resolve '@sanity/client'

I keep getting this error on localhost Failed to compile ./lib/client.js:1:0 Module not found: Can't resolve '@sanity/client' > 1 | import sanityClient from '@sanity/client'; 2 | import ...
DiwSlow's user avatar
  • 21
2 votes
1 answer
82 views

Dynamic pages at load time, not build time

I'm building an editorial site that regularly adds new content. As such, they've requested that articles and article content is loaded in at load time rather than having to run a build and wait for it....
Chrish D's user avatar
2 votes
0 answers
667 views

Next.js 13 'TypeError: fetch failed' while trying to render static pages using getStaticProps. Need help fixing code

I'm new to APIs. I'm using Sanity for my backend. This is the error I get in the terminal: - info Linting and checking validity of types - info Creating an optimized production build - info Compiled ...
Ishaan2053's user avatar
2 votes
1 answer
398 views

Why does sanity cli get error while install it?

I'm trying: npm install -g @sanity/cli >> sanity init --coupon javascriptmastery2022 and I get this message: sanity : File C:\Users\...\AppData\Roaming\npm\sanity.ps1 cannot be loaded. The ...
Ronen Amir's user avatar
1 vote
1 answer
3k views

"query" is not a valid Page export field - When Trying to deploy NextJS13 and Sanity.io to Vercel

I'm learning NextJS13 and was following a blog tutorial online by Sonny Sangha 'Let’s build a BLOG with Next.js 13 (Sanity v3, TypeScript, Tailwind CSS, Auth, CMS, Preview Mode)'. Upon completion of ...
realzire's user avatar
1 vote
2 answers
2k views

Could not resolve dependency with sanity in nextjs app

I am trying to deploy my next.js project, but I keep getting the following error with everything I do: npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! ...
Thibaut's user avatar
  • 23
1 vote
0 answers
88 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-...
Marius Fredriksen's user avatar
1 vote
0 answers
16 views

Sanity Studio commands not working and encountering syntax error on Mac M1 with Visual Studio Code - How to troubleshoot?

Getting syntax error while accessing local host of sanity studio. Uncaught error: The requested module '/schemas/testimonials.js' does not provide an export named 'testimonials' http://localhost:3333/...
AM14's user avatar
  • 11
1 vote
1 answer
141 views

Node.js not finding the default system root

I was trying to configure sanityCMS on my machine and node.js decided to "forget" the system root. I spent a couple hours trying to fix it and since it decided not to, I went back to my expo ...
BladedShip's user avatar
1 vote
0 answers
425 views

ClientError: Unauthorized - Session does not match project host

Please help me out with this. I was trying to run npm run build but got this error instead. If you want anything, please comment! I was expecting a green check!
Devansh Singh Parmar's user avatar
1 vote
0 answers
173 views

How to upload images from remix to sanity.io?

I am trying to upload images from a remix app to sanity.io from a server action where I am sending data through form submit using encode type multipart/formData. I cannot understand how to parse the ...
Anam's user avatar
  • 86
0 votes
2 answers
5k views

How do i fix "npm does not support Node.js v12.14.1" when they came from the same LTS download?

Truthfully this has never happened with me on any development environment My node version: 12.14.1 My npm version: 6.13.4 I was building a Gatsby Site using Sanity.io as a CRM and Im getting this ...
thelovesmith's user avatar
0 votes
1 answer
81 views

`part:` modifier in node import statement

I came across this code in a javascript / Node project but can't find any explanation online as to what it is and how it works. import PatchEvent, {set, unset} from 'part:@sanity/form-builder/patch-...
Michael Martinez's user avatar
0 votes
2 answers
1k views

zsh: command not found: sanity

Hi I have installed the Sanity CLI using: npm install -g @sanity/cli However when I try sanity init, I get: zsh: command not found: sanity it does work when I use: npx @sanity/cli init However when I ...
Gmcintosh's user avatar
0 votes
1 answer
828 views

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 ...
Bhavin Patil's user avatar
0 votes
1 answer
491 views

Publish document after creating with sanityClient

I need to insert alot of data into sanity and I will do this with a node script. My issue is that the documents does not seem to publish once I insert them. I use client.create(data) and the data is ...
Moddah's user avatar
  • 51
0 votes
1 answer
186 views

Is there a way to translate Sanity Studio?

I'm trying to use Sanity for the first times, as it looked a good headless CMS approach. But I didn't find any ways to change the interface language. Does anyone know how to do that?
rdrgtec's user avatar
  • 624
0 votes
0 answers
14 views

I Am using Sanity and facing this issue

I am making my portfolio site. In it I have used sanity for CMS, NOw after making schemas and installing next-sanity, whenever I try to fetch data by importing createClient it showing me the below ...
Talha Ghauri's user avatar
0 votes
0 answers
47 views

sanity shopify assets plugin fails

This may be too vague, but ask any question and I will try to get code or give an explanation to troubleshoot this issue. We are using Sanity to build out a cms for our Shopify store, at this point we ...
SocaBlood's user avatar
  • 189
0 votes
1 answer
664 views

TypeError - sanityClient is not a function

const sanityClient = require('@sanity/client') const client = sanityClient({ projectId: 'PROJECT_ID', dataset: 'production', token: process.env.TOKEN }) I'm passing parameters in netlify functions ...
user avatar
0 votes
1 answer
315 views

Can't login to Sanity via VSC terminal

? Login type Google Opening browser at https://api.sanity.io/v1/auth/login/google?type=listen&uuid=2f9ed7bd06d956276b1709dc4c0ed24f&source=cli&label=Denzel-PC+%2F+win32 ⠋ Waiting for ...
Denzel Domingo's user avatar
0 votes
1 answer
495 views

Next.js and Sanity V3 Studio Unhandled Runtime Error: TypeError: Cannot read properties of undefined (reading 'call')

I am trying to use Sanity V3 and Next.js 13 in order to create a blog post. But when I go to /studio an error happens Unhandled Runtime Error TypeError: Cannot read properties of undefined (reading '...
VladosNinja's user avatar
0 votes
1 answer
117 views

How can I complete the Sanity init while error during "resolving latest module versions" keeps appearing

When trying to init Sanity I keep getting this error during the "resolving latest module versions" step. Error: connect ETIMEDOUT xxx.xx.xx.xx:xxx at TCPConnectWrap.afterConnect [as ...
J324's user avatar
  • 11
0 votes
0 answers
1k views

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 ...
Ameiz's user avatar
  • 696
0 votes
0 answers
190 views

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: ...
Ayush's user avatar
  • 49
0 votes
1 answer
249 views

npm run graphql-deploy command stuck in Sanity

When I am running, the command npm run graphql-deploy in my local it stuck at lerna info Executing command in 1 package: "npm run graphql-deploy". Not moving forward. And if I run same ...
Aman Sharma's user avatar
0 votes
1 answer
44 views

Sanity Studio CMS on initialise script (upstart)

Is there a way to hook into the Sanity Studio initialise step? Or perhaps start the Studio from a js module so I can wrap it in some logic? My motive is, in development it can be confusing which ...
Lex's user avatar
  • 4,873
-2 votes
1 answer
426 views

Unhandled - error Encountered an unhandled error in this Studio. Error When I started the Sanity Start. I got this error [closed]

TypeError: Cannot read properties of null (reading 'jsonType') at validateNonObjectFieldsProp (/static/js/app.bundle.js:170029:16) at _default (/static/js/app.bundle.js:169997:155) at visitors.reduce....
Naimat Official's user avatar