42,166 questions
0
votes
0
answers
15
views
Next.js artifact built in CodeBuild fails on EC2: MODULE_NOT_FOUND / 'next' not recognized (node_modules missing)
Correctly Deploying Next.js App to EC2 Using CodeBuild + CodeDeploy (Missing next at Runtime)
What I think is happening
CodeBuild successfully runs npm install and npm run build.
The generated ...
-4
votes
0
answers
27
views
Next.js: Hydration failed por “Unexpected attribute cz-shortcut-listen" — como resolver? [closed]
Pergunta
Estou recebendo o seguinte erro ao iniciar meu projeto Next.js:
Hydration failed because the initial UI does not match what was rendered on the server.
Unexpected attribute: cz-shortcut-...
0
votes
1
answer
19
views
How do I enable streaming in a NextJS app that is self hosted?
We are self-hosting the NextJS app with an Nginx proxy. The streaming functionality allows for the suspense states to show up while the page is loading. I am aware this is available by default if the ...
-5
votes
0
answers
39
views
next js package.json devdependance Question [closed]
in package.json in next js:
"devDependencies": {
"@tailwindcss/postcss": "^4",
"@types/node": "^20",
"@types/react": "^19&...
0
votes
1
answer
53
views
App Freezing when I submit a form using Actions in Next app?
I'm currently working on my first NextJS app after a long hiatus. The first thing I'm working on is a small app that's powered by Firebase.
After reading some documentation on Context and then ...
Best practices
0
votes
2
replies
77
views
Best way to initialize data in next js app router with zustand
I’m building an e-commerce type website in Next.js where there are multiple sections of stores. Each store card has a heart icon to mark it as a favourite.
The same store can appear in:
multiple ...
-1
votes
1
answer
29
views
How to manage multi-region branding (colors + UI variations) in a single Next.js repo without increasing code complexity? [closed]
I’m working on a telco project that will be deployed across eight different regions.
Each region will have:
Different color branding
Possibly some UI component variations
However, all API ...
0
votes
0
answers
25
views
Next js 16 Turbopack build error."TypeError: Cannot read properties of null (reading 'constructor')"
After upgrading to next js 16, i'm getting the following error when i run pnpm build. But it is working find when using webpack.
The error:
> pnpm build
▲ Next.js 16.0.3 (Turbopack)
- ...
-1
votes
0
answers
36
views
Usage of multiple created npm modules in one project via npm workspaces
I have created a Next.js (TypeScript) application, called "vkdgen".
Afterwards, I've created and published a small component library for my project called "vkdFramework4NextJS". ...
1
vote
0
answers
55
views
How do I resolve `state_mismatch` error with Google OAuth in a Next.js app using Better Auth?
I have a Next.js application with Better Auth setup. I can sign up and log in fine using email and password. I implemented OAuth sign in with Google, but that only worked once or twice. If I somehow ...
-1
votes
0
answers
49
views
Is there a way to call the tRPC client with tRPC and @tanstack/react-query setup? [closed]
I have set up my tRPC backend as per the docs which I'll paste in below. My issue is using it with @tanstack/react-query works perfect for 90% of my use cases but I can't physically call my backend ...
1
vote
0
answers
41
views
Getting a prerender error that a file is consuming server side logic but its client side
I'm using the entry file at the root of my app as a data layer, for redirects depending on session, which I'm retrieving using getServerSession. If at a point no session exists, user should be ...
0
votes
2
answers
55
views
Tailwind dark mode classes not working even though .dark class is applied [duplicate]
I'm trying to implement dark mode in my Next.js app using TailwindCSS. However, TailwindCSS's dark: classes are not being applied, even when the .dark class is present on the <html> tag.
global....
0
votes
1
answer
58
views
Laravel + Next.js show method
I know it's an unconventional pairing, but I am using Next.js and the Laravel stack for my app.
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\...
-1
votes
0
answers
38
views
Work with npm local packages in NextJS project
I need to work with a local package with my next.JS project. To avoid publishing on npm every time :
- On the next.js project: npm i ../test-sample-api. I can now see on my package.json the line : &...
Advice
1
vote
1
replies
50
views
How do I make an authenticated request from my Next.js API on Supabase with RLS enabled?
In my case, I only want authenticated users to perform a SELECT query on my database, so I set up my RLS Policy for this scenario. This is where I am hitting an issue. With RLS enabled, I need to let ...
Best practices
1
vote
3
replies
109
views
What is the best practice for sharing types between a NestJS API with Prisma ORM and client applications?
We currently have a NestJS API using Prisma ORM. The API is used by multiple Next.js applications in different repos. To help with type safety across the various repos, we have a common "types&...
-3
votes
0
answers
38
views
Why do many developers recommend CSR for apps behind an authentication/login wall? [closed]
I’m learning the basics of web development and recently got into different types of rendering (CSR, SSR, SSG, etc.).
Server-side Rendering (SSR)
Client-side Rendering( CSR
Static Site Generation (SSG)...
Best practices
0
votes
3
replies
38
views
Nuxt.js pre-render data in the server for the seo purpose
We have a nuxt.js project which is an ecommerce site. We load the products page with first 100 products as SSR. after that we load other products as we needed from the client side using an API call. ...
Tooling
0
votes
2
replies
47
views
How to write tests which analyze HTTP requests made on NextJS server side?
I work on a NextJS project with Pages Router. We are using Jest for unit tests and Playwright for E2E.
The application we are making is a funnel with several steps. Each step is a form with several ...
0
votes
0
answers
29
views
Tabulator table layout suddenly became broken (missing borders, inconsistent cell size)
I am using Tabulator in a React (Next.js) application to build a spreadsheet-like data entry grid.
Until recently, the layout was perfect: compact cells, tight borders, correct alignment.
After a ...
Best practices
0
votes
0
replies
34
views
Next JS v16.0.3 TypeScript - The following required properties are missing: fb:app_id at Facebook Debugger
I am trying to develop an app using Next JS v16.0.3 App router TypeScript . Except facebook debugger id that called fb:app_id, all other meta tags are working good.
At inspect element it shows as ...
-1
votes
0
answers
48
views
Next.js API route returning 404 when calling axios.post from client component
I'm using Next.js (App Router) and I'm getting a 404 error when calling my API route from a client component.
I restarted the server, verified the folder names, and even tried hitting the URL directly,...
Tooling
0
votes
1
replies
49
views
Matching compression libraries between GO and NPM
For context:
I have 2 projects of next.js and go respectively, previously I had a logic to compress some data in next.js backend (getServerSideProps) then send this data to next.js client side and ...
1
vote
1
answer
69
views
Passing user data from NextJS middleware to the client component
I want to pass the data from the NextJS middleware to the client component. I am using NextJS for the frontend, and an Express API for the backend.
I could do it with X-Headers but what I want to send ...
0
votes
2
answers
136
views
ScrollTrigger not working after route navigation (works on localhost, breaks in production)
I'm stuck with a weird ScrollTrigger issue in my Next.js app and could really use some help.
What's happening
I have a section on my homepage that uses GSAP ScrollTrigger to pin and animate when you ...
0
votes
0
answers
48
views
TRPC prefetching fails on protected procedure
I was working on a nextjs monorepo using trpc as backend I am integrating SSE with normal trpc methods, I implemented auth using better auth and it works very smoothly, but when I try to prefetch on ...
0
votes
1
answer
58
views
Inifinite loading with generateMetadata in Next.js 15.3.3 and React 19.2
I’m trying to generate dynamic metadata using the built-in Next.js method generateMetadata. On localhost, it works: it fetches the title, reads the related article, and generates the metadata in the &...
0
votes
1
answer
41
views
Next.js <Image> fails with Directus: "url" parameter is not allowed"
I’m using Next.js 16.0.1 and loading images from a Directus /assets/<id> endpoint.
The Directus asset URL works fine in the browser: https://<directus-domain>/assets/<id>
But when ...
0
votes
3
answers
81
views
why nextjs is sending async prop from a component to a suspended child component [closed]
import {Suspense} from "react"
type Props = {
params: Promise<{joblistingId: string }>
}
export default function JoblistingPage(props: Props) {
return (
<...
1
vote
1
answer
87
views
Tailwind CSS directives (@tailwind base) underlined as unknown in VS Code with Next.js project
I'm working on a Next.js 16 project and trying to set up Tailwind CSS v4. I installed Tailwind via npm:
npm install -D tailwindcss postcss autoprefixer
I also created the following config files ...
-4
votes
1
answer
59
views
Zoho Mail contact form with Nodemailer not workign
I connected my domain to a Zoho mail account. Then I was trying to fill in the account data in my env file to use Nodemailer contact form in Next.js application.
Before that all the contact form ...
1
vote
1
answer
46
views
How to enable Undo and Redo using Quill?
I am using Next.js 15.5.4, React 19.1.0, and the package react-quill-new 3.6.0 for a blog editor.
The editor works fine, the toolbar works fine, and all formatting options are working.
But now I want ...
0
votes
0
answers
51
views
I can't move from panorama image to next one inside immersive web experience
Inside the VR mode, I can move from image to another I use my own fetching API.
I tried to move to the next panorama, but it is not moving inside the scene. I was trying multiple solutions, nothing ...
0
votes
1
answer
65
views
Next.js App Router API Route: @ffmpeg-installer/ffmpeg throws "Module not found" and "server relative imports not implemented" error
I'm trying to convert a WebM video file to MP4 using fluent-ffmpeg and @ffmpeg-installer/ffmpeg in a Next.js 14 API route (using the App Router). The same code worked perfectly in a standalone Node.js ...
2
votes
1
answer
73
views
What's the proper way to handle canonical URLs in Next.js for multi-region international sites?
I'm building an e-commerce site with Next.js 14 that supports multiple regions and languages, and I'm struggling with canonical URL implementation. Here's my situation:
We have URLs like /en/us/...
0
votes
1
answer
49
views
NextAuth module augmentation not working in Turborepo monorepo (Property 'id' does not exist on type 'Session.user')
I’m using a Turborepo monorepo with a Next.js 15 App Router project (apps/web) and a shared packages/types package that contains my NextAuth module augmentation.
However, TypeScript still gives this ...
-3
votes
0
answers
29
views
Next.js ChunkLoadError Only for US Users App Works Fine in India
Stack
Next.js 14.2.2
EC2 (Mumbai, ap-south-1)
Nginx reverse proxy
Cloudflare CDN (recently added, but issue existed even before)
The Issue
After deploying to production, our Next.js app works ...
0
votes
0
answers
14
views
Vercel production deploy failing with Contentful ETIMEDOUT during Next.js static generation (but preview and local builds succeed)
My Next.js app deploys successfully in preview and builds fine locally using a .env.
However, the Vercel production deploy (triggered via GitLab CI) fails with multiple
FetchError: request to https://...
-1
votes
1
answer
91
views
Alias import issues in Vitest
I'm trying to have Vitest + Storybook setup and the following is my vitest.config.ts:
import path from "path";
import { fileURLToPath } from "node:url";
import { defineConfig } ...
1
vote
1
answer
69
views
robots.txt doesn't work, only url/robots does work
In my Next.js app, I'm trying to generate the robots.txt file dynamically. However, when I access http://localhost:3000/robots.txt, it redirects to the "Not Found" page. If I change the next....
1
vote
0
answers
68
views
Strapi v5 Google Auth: "Grant: missing session or misconfigured provider"
I'm trying to set up Google authentication in Strapi v5 using the Users & Permissions plugin, with a Next.js frontend.
The problem happens right after I accept the Google login.
Instead of ...
0
votes
1
answer
76
views
AWS Cognito Google Sign-in with Next.js works, but Sign-out does not fully log the user out
I’m using AWS Cognito with Google as an Identity Provider in a Next.js app. I am using AWS managed login as well. Sign-in works correctly, tokens are received, and the user session persists. However, ...
0
votes
1
answer
50
views
When upgrading to React 19 and NextJS 15, jest snapshots that had header changes via `next/head` break
In our tests, we had several snapshots that included content wrapped in next/head. We had previously followed the below pattern for the mock, which allowed us to see all the header tags like meta, ...
0
votes
1
answer
53
views
Issue in running an ai agent using inngest agent-kit
enter image description here
Each dependency is properly installed . The error is specific to the line :
const result = await summarizer.run(
`Summarize the following text: ${event.data.value}`...
-1
votes
0
answers
41
views
Why doesn't Next.js Server Action throw an error when IAP returns 401 Unauthorized on Cloud Run?
I'm deploying a Next.js 14 app on Google Cloud Run, protected by IAP (Identity-Aware Proxy) and fronted by a Load Balancer.
Everything works fine when the user is logged in with a Google account. ...
0
votes
1
answer
44
views
In Next js project Error: <Html> should not be imported outside of pages/_document
I have having issues in vercel and render deployment, but i have checked all instances but not happening i have check other answers also but it is not working. Are there any things which I can do for ...
0
votes
1
answer
610
views
Nextjs TypeError: localStorage.getItem is not a function node version issue
I worked on my other system it works but when i installed the latest npm==10.9.3 and node==25.1.0, and next==15.3.3 it will pop out the following error and cannot render any web page.
⨯ [TypeError: ...
1
vote
1
answer
48
views
Nextjs 15.2 Mdx, Shiki, Rehype-pretty-code Build error
So I'm trying to build my Next.js project, which, for context, was being deployed without a problem, up until my main branch. When I then tried to implement mdx, with rehype and shiki, and tried to ...
Advice
0
votes
0
replies
48
views
How to properly build an HR Management System using Laravel (API) + Next.js (frontend) with token authentication and middleware?
I'm building an HR Management System using:
Backend: Laravel
Frontend: Next.js
Authentication(SPA): Laravel Breeze (already set up for backend)
I'm a beginner in Next.js, and I’m a bit stuck on how ...