Category "next.js"

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

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