Questions tagged [getserversideprops]
103 questions
1
vote
1 answer
Server Error TypeError: resolver is not a function with next auth custom sign in page
I get this error for some reason when I try to access my login page. I am using the t3 stack with next auth.
Here is my [...nextauth].ts file
export const authOptions: NextAuthOptions = {
// Include user.id on session
callbacks: {
session({…

ClarenceHD
- 139
- 1
- 11
1
vote
0 answers
getServerSideProps with react-query doesn't work (prefetchQuery)
First of all, I'm using a custom hook for react-query.
The custom hooks is as follows.
export const useGetUser = (id: number) => {
return useQuery(
['useGetUser'],
() => Api.getUser(id),
{
retry: false,
…

skwFE
- 211
- 3
- 9
1
vote
0 answers
Pass props to Layout in NextJs
import Head from "next/head";
import Image from "next/image";
import { Inter } from "@next/font/google";
import styles from "../styles/Home.module.css";
import Layout from "../layouts/Layout";
const inter = Inter({ subsets: ["latin"] });
export…

karthi
- 31
- 2
1
vote
1 answer
Avoid calling React hooks conditionally when using getServerSideProps in Next.js
I am using getServerSideProps() to fetch data on the server side and then display it to the user:
export const getServerSideProps = async () => {
// fetch some data...
if (some_error_condition) {
return { error: "Something happened"…

Nils
- 1,755
- 3
- 13
- 25
1
vote
0 answers
Any reason as to why this isn't fetching the firestore data and displaying it on said page? Using the nextjs 13 app dir
I'm currentl trying to fetch the firestore data from firebase on Nextjs using the new App directory. But it seem to be defaulting to "the community does not exist...." page instead.
Can't seem to be able to fetch the data in the new App…

Jonas
- 11
- 2
1
vote
0 answers
Getting Undefined using Props with Map function, how can it be resolved?
I'm trying to integrate Mapbox to a tutorial page I'm working on using following code ang calling API:https://www.jsonkeeper.com/b/5NPS, however instead of getting Object values I'm getting "undefined "
AirBnbMap.js (component)
import { useState }…

Sameer M
- 21
- 2
1
vote
0 answers
How to solve 504: GATEWAY_TIMEOUT error in vercel deployment
I have deployed my next js project in vercel it's showing 504: GATEWAY_TIMEOUT error on those pages where i have added getServerSideProps function. I am not calling any api request on this getServerSideProps.I am just using this function so that i…

Rabeya Aktar Ety
- 13
- 4
1
vote
1 answer
access Nextjs httponly cookie
I'm working on a Nextjs app and I'm using Laravel api for auth and other things.
So I was searching about the best way to store the token that i will get when I sign a user in or sign him up from that Laravel external api and as I found storing it…

Mooder
- 31
- 2
1
vote
2 answers
Next.js Hydration Error: Text content does not match server-rendered HTML. U+202F vs. U+0020
I am working with dates and Next.js. Below are the three errors I am getting:
Warning: Text content did not match. Server: "Tuesday, January 24, 2023 at 11:01 AM" Client: "Tuesday, January 24, 2023 at 11:01 AM"
Error: Hydration failed because the…

Rafael Almeida
- 11
- 2
1
vote
0 answers
Next.js getStaticProps/getServerSideProps best use case
I have a blog that is using getStaticProps + getStaticPaths to generate pages from headless WP - all good. Then I have a component that is connecting to the database to allow me to link to the next post in any within any individual category. This…

jk2908
- 56
- 4
1
vote
0 answers
How to API integration in nextjs
I am using this API, https://api.xmltime.com/holidays?accesskey=dYjG8ztthf&secretkey=veUV06dNmrnp7bbaYq0u&version=3&country=ro&year=2021&lang=en
The API is running in my local PC - https://localhost:5001/api/holiday?&country=ro&year=2021
I tried to…

hanu
- 53
- 1
- 10
1
vote
0 answers
Next.js getServerSideProps catches an icon request
why is the getServerSideProps method catching the icon request
This is breaking my application
i can't figure out how to fix this
For example, I expect the address to be equal
/[dymaniclocale]/user
but in fact it is equal…

Ascolon
- 97
- 1
- 7
1
vote
1 answer
getServerSideProps proper usage?
I have recently been trying to create a web app with NextJS. I know some basics in web development but I was a little lost when using NextJS as I didn't do any React either before.
I've tried fetching data from an API and using this data in my page.…

pironc
- 51
- 1
- 9
1
vote
0 answers
Can't read Next.JS getServerSideProps return's in page - Typescript
I'm trying to get some data in getServerSideProps, but I can't read in front, I'm aready follow all Vercel's tutorials and still getting undefined from props that came from getServerSideProps, the props that I get in front
GetServerSideProps…

Andre Teizen
- 13
- 3
1
vote
0 answers
Next JS getServerSideProps try block failing when getting token in Vercel
I am trying to hide one of my routes in NextJS behind firebase Auth. I am storing a token in the context and retrieving the token in getServerSideProps. This works in development but once deployed to Vercel it fails.
I see the cookie is there after…

Craig Bauer
- 76
- 7