Category "next.js"

Next.js ISR pass additional data to getStaticProps from getStaticPaths

In SingleBlogPost.jsx i have: export async function getStaticPaths() { const res = await fetch("http://localhost:1337/api/posts"); let { data } = await res.

How to use Azure application insights with nextjs app

I want to use Azure app insight with nextjs but unable to do it , can anyoe help me with that?

NextJS - Too Many Open Files Error in Production

I'm facing an issue in my Production environment during peak traffic hours. Any help on identifying the source of this error would be really appreciated. Error

ESIDIR Error in NextJs, even if the code come from the official page

I need to learn Next.js for an interview, so I started to follow the tutorial published in Next.js official web page. It was all ok, until I arrived at this sec

Adding Google Ads Code in NextJS for Automatic Units

I'm working on a nextjs project and I have to implement the google AdSense code that is for automatic ads. So, my google ad code is just this: <script asyn

This error happened while generating the page. Any console logs will be displayed in the terminal window

1st time its show this error I want to make an API call to my API route using Axios. When I run my code the first time its shows that error but when I refresh

How to take benefit of Image component from Next.js and framer-motion svg animation

I have a Next.js project, where I am using framer-motion for some animations. I have the following code where using framer-motion I animated an svg: function Te

Next.JS and Mongoose models

I'm building a pretty simple next.js app for a client and for my life I cannot figure out why I keep getting Cannot overwrite User model once compiled. It seems

Does getStaticProps fetch data every time I get back same page?

I am using routes to get page ex. page/[id].js and show data for that id only. So will it refetch data every time I visit this page? ex. going to the next page

FormData with NextJS API

Background I am trying to create a simple CRUD application using NextJS along with react-redux, so what it does is that it saves peoples contacts.So when adding

Prisma, update scalarList/array

I´m doing an Spotify clone and I´m trying to add a song to a playlist but my query doesn't work, until this point, everything was good following the

Draft.js headers do not get rendered properly

I have a next.js environment with tailwind installed and a simple draft.js Text Editor. In my Toolbar Component I toggle inline style and block styles. Everythi

Emailjs working in development but not in production

I have a Next js app that have a contact form. I'm using Emailjs to send email to my gmail account. This works perfect in development, but once I deployed it st

In reactjs and nextjs constructor getting Reference Error: localstorage is not defined

i make system jsonwebtoken in reactjs and use nextjs. i find problem when i run the code in browser that is localStorage is not defined. this is my code in fil

How to use JWT stored in cookie in NEXT _middleware

This question extends my last question and is primarily for me who might get stuck again. I'm trying to rebuild an app in Next.js that has this login form using

How to enable 12-factor application bundling with Next.js?

Reading the Next.js documentation about environment variables - In order to keep server-only secrets safe, Next.js replaces process.env.* with the correct valu

Nextjs config with postcss nesting doesn't work

I am using nextjs with tailwindcss and i am facing the difficulty in adding postcss-nesting to my nextjs app. Here is the configuration below for the same : nex

API Routes vs getStaticProps

Sorry to ask but I don't quite understand what the difference is between the two. With getStaticProps you can get data via fetch and display it on the site and

Fetch error when building Next.js static website in production

I don't understand these errors when I export as production npm run build , but when I test npm run dev it works just fine. I use getStaticProps and getStaticPa

TypeError: Cannot convert undefined or null to object in NextAuth

NextAuth.js automatically creates simple, unbranded authentication pages for handling Sign in, Sign out.So I created it like the document suggest.I created in s