All Questions
11
questions
1
vote
1
answer
50
views
NextJS / Sanity Fetch Logs
I keep getting verbose console output when using Sanity's fetch() function (from createClient in next-sanity) like so:
export async function getPeople(): Promise<Person[]> {
return ...
1
vote
1
answer
762
views
why does my API route in next.js is giving 404 error
why does my fetch request gives me the error "GET http://localhost:3000/api/db/getRideTypes 404 (Not Found)" when trying to fetch data from sanity client.
The partial code of Rideselector.js ...
1
vote
1
answer
245
views
How to query all images in an array?
I'm using nextjs/Sanity. Want to get all of the image types out of an array, but nothing is showing up and nothing is coming up in the console either. It's particularly everything within the current ...
0
votes
3
answers
115
views
React ARRAY Warning: Each child in a list should have a unique "key" prop
I have a document (Sanity Schema) called 'category' that contains an array called 'contained_sets', which references another sanity schema document called 'set'.
E.g., the category 'exhibitions' has a ...
0
votes
1
answer
1k
views
React & Sanity - Fetch Error: invalid JSON response body
I have been following a tutorial on youtube to build a twitter-clone website. However, when trying to fetch tweets from Sanity I am getting this error. I even git cloned the repo of the person that ...
0
votes
3
answers
1k
views
Having problems with fetching data in client Next 13 & Sanity
I've tried a lot of different ways of fetching data in client components in Next 13, but none of them seem to work. I also installed a library, react query but it doesn't seem to work either. Can ...
0
votes
1
answer
119
views
I am fetching my Sanity data (hero) with useEffect but when I use the data in the return statement the website crashes
When I console.log hero I get all the data. But when I use hero.tag or hero.heading anywhere in the return statement the site does not load.
Uncaught TypeError: Cannot read properties of undefined (...
0
votes
1
answer
75
views
How to convert this react-style fetch-api to next.js?
I've just realised the way I've been fetching data from my backend (Sanity) is better suited for react app than next, so I'm trying to convert what I have at the moment. For transparency, I'm trying ...
0
votes
1
answer
311
views
How to fetch item from array (first image in an array of images) from SanityClient?
I have a group of sets, I want to show an image from each set on my webpage which users can use as a link to their respective galleries. So I want to fetch an item (an image) from an array of images. ...
-1
votes
1
answer
574
views
'Fetching is not a function'- Sanity
I'm getting the error message:
Uncaught TypeError: _sanity_client__WEBPACK_IMPORTED_MODULE_2___default(...).fetch is not a function
I can't figure out why. Its referencing line about.js:11:1 which is ...
-1
votes
1
answer
364
views
Can't fetch item from current slug content- Sanity/Next.js
I'm trying to get the set_name from the set schema that is associated to the current slug. *[_type == 'set']{set_name, slug} is how the schema looks. I'm not getting the set_name when I click on the ...