All Questions

Tagged with
Filter by
Sorted by
Tagged with
77 votes
1 answer
50k views

Next.js: Reduce data fetching and share data between pages

I'm looking for solutions for better data fetching in a Next.js app. In this question I'm not just looking for a solution, I'm looking for multiple options so we can look at the pros and cons. The ...
eivindml's user avatar
  • 2,350
9 votes
2 answers
6k views

Getting the "URLSearchParams.set is not implemented" error when trying to fetch data from my sanity backend using React Native

I am getting an error in my to react native project when pulling data from my sanity backend    this is the error URLSearchParams.set is not implemented This is where I am fetching he data  import {...
christian fasole's user avatar
1 vote
1 answer
891 views

Sanity Groq function - array of unique values

I need some help regarding fetching some data. I'm building blog with Nuxt3 and Sanity and I use https://sanity.nuxtjs.org/ module. I need query to get all the unique tags from _type article so I can ...
mart cube's user avatar
  • 665
1 vote
0 answers
3k views

FetchError: request to http://localhost:3000//api/getPageInfo failed, reason: connect ECONNREFUSED 127.0.0.1:3000 [duplicate]

In development, the project runs smoothly, but when I try to deploy on vercel I get the error Error occurred prerendering page "/". FetchError: request to http://localhost:3000/api/...
Antônio Miguel's user avatar
1 vote
2 answers
2k views

I'm trying to fetch data from sanity.io

I'm trying to get data from sanity but when I try to fetch its causing an error. Here is my code ... useEffect(() => { const query = '*[_type=="abouts"]'; client.fetch(query).then((...
Ishraque's user avatar
0 votes
1 answer
1k views

Sanity CMS custom sorting

I don’t know if exists some way to sorting the results by custom field. My query: *[_type == "movies" && actors] { ..., isHarryMovie: name match "Harry*" } So I ...
Cristian Ronda's user avatar
0 votes
0 answers
87 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: '...
Barbara Makarova's user avatar
0 votes
0 answers
449 views

Error occurred prerendering page "/". TypeError: fetch failed

I am getting this error on command screen while running 'npm run build' but 'npm run dev' is running fine and because of this I am not able to deploy this project. I am using nextJS 13 Error occurred ...
Devansh Jain's user avatar
0 votes
0 answers
60 views

How to POST file API Contents to external API

export default function Component() { const handleChange = (e: ChangeEvent<HTMLInputElement>) => { const [file] = e.target.files!; console.log(file); fetch("/api/...
Amit Kumar's user avatar
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()...
Dukatela's user avatar
0 votes
1 answer
200 views

GROQ query to find all posts with a specific location

I have set a sanity schema that present a restaurant and the restaurant has an array of locations that accept multiple string(cities) as shown in the picture. I am asking if there is a way to fetch ...
Abdellah Slimani's user avatar
-1 votes
0 answers
494 views

React Native and Sanity Fetch Request Problems/Mistake?

I am trying to fetch data from a Sanity Database HTML link but eveything i try it does not work... I am trying not to use the sanity client but just the link itself (Http:....) import React, { ...
Josef Pa's user avatar