Category "next.js"

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

How to solve redux-persist failed to create sync storage. falling back to noop storage. in nextjs

Here is the version am using => "redux-persist": "^6.0.0", Error: => redux-persist failed to create sync storage. falling back to noop storage.

Next js getServerSideProps redirect with props

Can I get the props after redirection? return { redirect: { destination: '/auth-page', permanent: false, }, props: { initialReduxState: {user}

How to use cookie inside `getServerSideProps` method in Next.js?

I have to send current language on endpoint. But getting language from Cookie returns undefined inside getServerSideProps. export async function getServerSidePr

Render error when using swr within react component

I am currently creating a blog and I am trying to add a viewcount to my blogposts. import { useEffect } from 'react' import useSWR from 'swr' const fetcher = (

Getting req.headers is undefined when trying to read from req object in NextJS

On page load, I try to fire off an authentication request if a token exists in local storage. // utils.ts const init = async () => { try { const

how to on-demand revalidate all the pages at once

I'm trying to revalidate all the pages of my website on a certain event, the problem that I'm running through is that I have to do it page by page : ... try {