All Questions
27
questions
5
votes
2
answers
5k
views
next.js13 fetching data with an async function and also use state?
i hope you are having a great day ! i got a question... i'm currently learning next.js 13 and so i thought doing a personal project with it would be a good idea . Currently i'm doing an e-commmerce ...
2
votes
2
answers
2k
views
Content is not updating until re-deploy nextjs 13 and sanity
Hello i am using nextjs 13 server components using /app directory and sanity studio. my code looks like this
const Page = async () => {
const query = groq`*[_type == "university"]`;
...
2
votes
1
answer
641
views
previewData is not a function error after updating NextJS
I have a NextJS and Sanity.io blog project. Today I updated NextJS from 13.2.3 to 13.4.2 and when I try to run it, I get this error:
Error: (0 , next_headers__WEBPACK_IMPORTED_MODULE_1__.previewData) ...
2
votes
1
answer
715
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 ...
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 ...
1
vote
4
answers
388
views
how can I reach my Sanity Studio under a sub route of my NextJs application?
How can I use Studio by Sanity v3 as a subroute in NextJs V13 if I have the following folder structure?
├── My Application
│ ├── pages
│ └── app
│ ├── src
│ └── studio
│ ├── schema
│ ...
1
vote
1
answer
623
views
Setting up Sanity Studio with Next.js 13 front-end gives me a SyntaxError
I'm trying to set up Sanity Studio with my Next.js 13 front-end. I added http://localhost:3000 to my Sanity project CORS origin and then, I created this sanity.config.ts file:
import { defineConfig } ...
1
vote
0
answers
289
views
Force Build Time Static Generation in Next.js 14.X
I have a blog built with Next.js 14.0.3 which calls a headless CMS API (Sanity) and I host it on Vercel. I've configured sanity to rebuild my site when I publish something new but I have run into ...
1
vote
0
answers
530
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
3
answers
882
views
next 13 server side function fetching stale data from the sanity v3 [duplicate]
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
1
answer
73
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
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 ...
0
votes
0
answers
63
views
Sanity auto caching data with nextjs 13 app router
It doesn't matter even if I update the data of my sanity backend as it's loading the caches again and again. I have to clear the browser cache and hard reload the website manually which is pretty ...
0
votes
0
answers
133
views
How to prevent my app/layout from displaying header and footer on sanity studio
I am having this issue where my header and footer from the app are appearing on my sanity admin page, and I assume it has to do with the layout.tsx file but I cannot seemt to fix it or find solutions ...
0
votes
1
answer
117
views
How do I make my sanity studio update to reflect on my nextjs app?
After setting up my sanity studio with the initial data it worked, but whenever i make a change and publish it, it still shows me my previous data in my next app. I even had to delete some data in the ...
0
votes
0
answers
47
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
0
answers
137
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
1
answer
1k
views
nextjs sanity TypeError: Cannot destructure property 'params' of 'param' as it is undefined. when using 'use client' directive on server component
I am new to Next.js, and I'm building an e-commerce site using Next.js and Sanity. I have a getProducts function that fetches product details from Sanity. In the ProductPage,I import the getProducts ...
0
votes
0
answers
67
views
How can I create a user using Next js 13 and Sanity.io
I have been trying to create a user and add it to the collection of user in sanity.io when ever a form is filled but I have been struggling and is not working.
This is the handleSubmit function:
const ...
0
votes
0
answers
66
views
NextJS v13.4+ Layout Structure
Can anyone help me? I have a situation where I have NextJS V13.4+ & Sanity CMS. I tried to do (user) and (admin) folders. Admin for sanity cms.
Now I have a problem layout structure. Can I use &...
0
votes
0
answers
74
views
Filtering localized content (Sanity / groq / typescript (Document Internationalization)
Could somebody please help me out with the following? Have a data set ('legal') in Sanity which contains a document-specific language field ('en'/'nl' etc (string 'language')). This is part of the ...
0
votes
1
answer
1k
views
NEXT JS 13 infinite loop on use State, Error on Params, and error on hook definition
I am trying to create a shopping cart with NEXT JS and I am facing different errors in my code. first thing first I have created a route [product]/[productitems] in my apps folder. in my page.tsx file ...
0
votes
0
answers
80
views
( Server Error ) Error: Unable to resolve image URL from source (undefined)
Does anyone have an idea how I can resolve this? I've tried everything I could find and nothing worked...
left the code "About.tsx" and the error
This is the "helper" I use to ...
0
votes
1
answer
221
views
Passing within components Next.js 13
I can't find a way to successfully pass const SanityData into function Home and when typing console.log(products,bannerData) data to be shown and used inside function Home.
I tried to call SanityData()...
0
votes
1
answer
108
views
What is the correct match of dependencies between NextJS13 and Sanity?
I'm trying to deploy a NextJs project using Sanity at the backend side, at deployment this error occurs:
[13:36:44.275] Retrieving list of deployment files...
[13:36:44.750] Previous build caches not ...
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 '...
-1
votes
1
answer
217
views
Issue with post request in sanity.io and Next.js 13
I have been trying to post a new user to my sanity content lake using the sanity mutation but for almost a week now, I kept on getting same error. This is the error:
http://localhost:3000/api/...