Category "next.js"

How to add module aliases to Jest testing in Next.js?

Currently I am using automatic imports in my Next.js project, configured by jsconfig.json in the root directory: { "typeAcquisition": { "include": ["jest"

NextJs Tailwind build (purge) removes all styling

In my current NextJS project, I am using Tailwind as a CSS framework. When I run yarn dev, everything works fine, but whenever I run yarn build followed by a ya

Next.js + Framer Motion scroll progress animation

So I want to create a viewport scroll progress circle with Framer Motion in a Next.js app (using tailwind as CSS). I used the example code from Framer Motion: h

no index.html file in my nextjs app. Netlify doesn't like that

Netlify wont allow you to deploy a website unless there is an index.html file. Nextjs didn't set me up with one when I did create-next-app. Anyone know how to f

Redirects doesn't work on netlify with nextjs

I simply followed the doc by adding this to my next.config.js module.exports = { reactStrictMode: true, async redirects() { return [ { so

React: add HTML from generic file path at server-side build time

The use case I'm trying to fulfill: Admin adds SVG along with new content in CMS, specifying in the CMS which svg goes with which content CMS commits change to

Get the client IP on NextJS and use SSR

I'm making a weather app, and I get the client IP with IPIFY, but this loses SSR, or I use SSR and I get the server IP. Someone told me that I could use the hea

Why are Next.js' req.query object's values of type string | string[]?

Next.js' API Routes receive a req object - it's an extension of http.IncomingMessage with additional middlewares such as req.query. The typing of req.query, fou

MaterialUI makeStyles undoes custom css upon refresh in NextJS

I am working on a NextJS site that has some custom styling that is being applied via MaterialUI's makeStyles. It works fine on the first load and then undoes al

Error: VM Exception while processing transaction: reverted with reason string 'ERC721: transfer caller is not owner nor approved'

i try to write NFT marketplace and i have problem with reselling items from user that buy item from owner and new, third user. I use next.js + openzeppelin + ha

Next js, ReactDom.render is no longer supported

I just spun up a new Next JS app with Next 12. I am getting this error on all page loads in the browser: Warning: ReactDOM.render is no longer supported in Rea

Next.js nested dynamic folder routing

Update: Which it causing this error because of [category_slug]-index.js that getServerSideProps? I tried to do index.js under product folder, it works, mean it

How to post data to supabase through next.js

I currently have a simple next.js website where users can look at projects for an organization, and at the bottom of the page, the user can input a new project

Redirect page to url Next.JS

I have a simple web page running next.js, the page just returns the "Hello World" element and I would like it to redirect me to another URL (youtube) instead. I

Firebase TypeError: Cannot read properties of null (reading 'indexOf')

When I console.log(docSnap) I'm getting a firebase error, see in the below image. I have tried all the solutions but none of them worked. useEffect(() =>

how to strongly type body of NextApiRequest in Nextjs [duplicate]

wondering how to define the type of body of an API POST Nextjs route in order to benefit from typesafety ? In the NextApiRequest, body is defi

Cannot read properties of undefined (reading '0')

I have a page coded in React with NextJS hooks, when I try to render a page the error says what's in the title, I presume because the object which I'm mapping i

next.js, is server side pages rendered faster?

I have a page that is hidden behind auth, so SEO doesn't matter. It includes fetching quite a lot of data. Will the page finish loading faster if I use SSR and

next.js, is server side pages rendered faster?

I have a page that is hidden behind auth, so SEO doesn't matter. It includes fetching quite a lot of data. Will the page finish loading faster if I use SSR and

Error When Writing Files in Node Environment with Next.js Deployed on Serverless Cloud Functions

I am building a Next.js app using the version 12.1.6 and Firebase Cloud Functions as a serverless function. In the local environment, it works without any probl