Category "next.js"

NextJS - new Date cached on server

i am trying to always get a now Date on my server, but it get a cached date. I use yarn export to upload my files on a hosting server via ftp. My code is: expor

Error: A required parameter (id) was not provided as a string in getStaticPaths for /location/[id] [duplicate]

im working on a next.js and mongodb website and im following this tutorial exactly but with different files/variable names. i keep running int

next build error occrred from performace-relayer

next build occurred error by ReferenceError: location is not defined at Object.<anonymous> (/PATH/node_modules/next/dist/client/performance-relayer.js

Moving Pages folder in Next.js application to src folder

In a create-next-app Next.js application, I want to move the pages folder in the root directory to a src folder. I added a jsconfig.json with the code (below),

How to get origin or domain name in Next.js [duplicate]

I can get the relative pathname using useRouter().asPath which gives something like /my-awesome-post but how to get the origin? Similar to wha

Nextauth token keeps on nesting

I updated with v4 beta with next-auth. But the token keeps on nesting on refresh, as in token converts to token.token to token.token.token .... on each refresh

How to make Next.js "see" the react-dom package?

This is my first ever Next.js project, and I encountered an odd obstacle. Even though I made sure at least 3 times that I have react-dom and react installed and

NextJs router seems very slow compare to React Router

I have a website built in React Js and the same one on Next Js as well. The problem which I am facing right now is, the router seems very slow in the nextJs com

NextAuth Credentials, adding more to the user scheme

Nextauth with mysql persisting users. I'm trying out this NextAuth thing to see if this is something I like. So far so good. There is one thing tho which is bug

Contentful + Azure static web apps trigger deployment

I have a next.js application on Azure static web apps. I've got it building on commit to github (via github actions). Next task is for changes on contentful to

Why did user object is undefined in NextAuth session callback?

I use NextAuth for signIn with discord provider and I need to add userID into the session object. For that I use session callback but user object is undefined.

how can i give type in getServerSideProps of Nextjs with typescript?

I'm using NextJs + TypeScript to make a little clone project, but I got a problem with type in getServerSideProps. As you can see, in getServerSideProps, I am f

Next-auth CredentialProvider config and redirect

I'm a bit confused on the implementation of the credentials provider and the redirects. The documentation says that the credentials provider doesn't support a c

How to implement FreshworksWidget into next.js project?

In Freshdesk docs they provide this script: <script> window.fwSettings={ 'widget_id':12000000025, 'locale': 'en' }; !function(){if("func

Error: getaddrinfo ENOTFOUND ingress-nginx.ingress-nginx-controller.svc.cluster.local

I am working with NextJS and I need for it to know when it's making a request on the server or on the browser. To do it on the server-side because I am building

How to get Auth0 User object in getServerSideProps?

I am trying to use Auth0 with NextJS for user authentication. After login I want to access the user object in getServerSideProps. I followed this link below, St

How to change route without re-rendering in Next.js?

I created a filter that when I clicked confirmed button changes url. For example, When I clicked page 1 and place type guesthouse in paris, url looks like this

useswr crashes react component

After adding an SWR data fetch to my react component it crashes, if I comment it out it works fine. I get the following error after uncommenting line const { da

not getting data when using SWR and context API in Nextjs

am trying to see the data am that am get from an API using SWR and also setting the currency in the API to what ever the user is using through context API but i

admin pages in Next js that only authorized users

I have admin pages in Next js that only authorized users should have access to. I have a cookie verification service: import { NextApiRequest } from 'next' impo