Category "next.js"

How to use next() function in Next JS API like Express JS?

While making an API in Next JS, where I pass three parameter to my API function (req, res, next) here is the code : import catchAsyncErrors from "../../../middl

How can I set a flash variable in Next.js before a redirect?

Laravel in PHP made this easy with https://laravel.com/docs/9.x/session#flash-data, so I figured Next.js would have an easy way too. I thought I'd be able to do

Next.js rewrite with x headers

I have a web app where users can build their own profiles with their usernames like below. ourplatform.com/john ourplatform.com/john/about ourplatform.com/john/

next.js .env.local - process.env keys missing when referenced with a string [duplicate]

I have a lot of values inside a .env.local file. NEXT_PUBLIC_GA_ID = myvariablevalue I wrote a function that checks if these are present: exp

Client side state is not hydrated from server on page reload

The client-side state is not hydrated from the server after creating a new store CodeSandBox Link - https://codesandbox.io/s/vibrant-aryabhata-l29r2b Steps to r

What does "First Load JS" in @next/bundle-analyzer actually measure?

The NextJS bundle analyzer gives some output like this: Page Size First Load JS ^

Can I export multiple named exports in a named set without affecting call to variable?

I have constants file with: export const VAR1 = 'VAR1'; export const VAR2 = 'VAR2'; export const VAR3 = 'VAR3'; export const VAR4 = 'VAR4'; export const VAR5 =

How to make scripts just run one time when app start?

I try to use facebook API for chat plugin.but it just work when i put the script in component like this FacebookPlugin.tsx import Script from "next/script"; imp

Type is not assignable to type 'IntrinsicAttributes & MoralisProviderProps'

I am new to typescript and I really want my initialize on mount to be set to true, Does anyone know why it will only let me set it to false? Here is the error:

CSS animation/keyframe speeds are different when looking at the site locally and on a code sandbox?

I have the exact same code on my local machine as I do on StackBlitz (an online Next.JS sandbox-type website), and for some reason - the animation speed for the

What's hydrate action in Next Redux Wrapper?

Recently I started using Next.js and I have a question about the next-redux-wrapper package. I don't really understand the HYDRATE action. So I wonder concretel

How to create fixed scrolling in Locomotive Scroll in Next.js

I'm currently using Locomotive Scroll with NextJS to implement smooth scrolling. The web app that I'm currently developing with NextJS requires a fixed scrollin

Nextjs: Cant render a component while using map over a array of objects. Objects are not valid as a React child

I dont know why when i want to render a component inside of a map function, basiclly i have a List component, and when i fetch data from an API with the email,

What Causes 400 Bad Request In Django Graphene and NextJs Using The useMutation Hook?

I am trying to build a simple todo app using Django, Graphene and NextJs. I was able to create todos in graphiQL and postman, however when I try to create a tod

next-images Error: Module parse failed: Unexpected character '�'

I'm trying to load an image with next-images: when i type in the image name it works fine: //Working <Image src={require(`../../images/exampleImage.jpg` )}/&

How do I deconstruct and display res from strapi api with usestate?

Im trying to display the titles, price, description and allergies from the strapi Api:http://localhost:1337/api/pizzasarpsborgs. api Not really sure how to deco

Problem with styled-components running React 18 and Next.js. Module not found: Can't resolve 'process'

I have to use React 18 for Suspense in a three.js/next/ts project (I have tried using next/dynamic and it does not work). So I installed it and updated everythi

useSelector doesn't update value in Next.js

I have a problem, createAsyncThunk function makes request to server (axios) and then get data, after that extraReducers handle builder.addCase in it and makes s

Warning: Prop `id` did not match. Server: "fc-dom-171" Client: "fc-dom-2" when using FullCalendar in Next.js

Context I'm using FullCalendar v5.11.0, NextJS v12.0.7, React v17.0.2 and Typescript v4.3.5. I wanted to create a simple calendar, based on FullCalendar documen

next-translate is returning key

Next translation is displaying key instead of lang common:menu.1.title common:read_more i18n.js module.exports = { locales: ['en', 'de', 'cs'], defa