42,131 questions
0
votes
1
answer
47
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
648
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
49
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 ...
-3
votes
1
answer
69
views
React/Next.js Layout & Dynamic Sizing
The Situation
Current Layout: The basic layout consists of a Header, a Left Navigation Bar (Sidebar), a Footer, and the Main Content Area.
The Task: I'm building a Preview Dialog/Modal.
Goal: When ...
0
votes
2
answers
42
views
Next.js multilingual routing. Main page site.com always redirect to site.com/en instead of staying on site.com
devs!
I'm trying to build a multilingual website based on Next.js(15.6) Node 22.21.10. Locally I have no issue with routing everything works as expected. Both lang versions are served as expected. (...
-1
votes
0
answers
72
views
Why my prisma seed.ts does not work for path "../app/generated/prisma"
import{ PrismaClient }from '../app/generated/prisma'
I see red underline for this line in my vs code and also having a error "module can be found" something like that in my terminal.
But it ...
2
votes
3
answers
92
views
Running `npm run wp-dev` fails with "Invalid Argument" error
I'm working through the faust.js documentation to create a headless WordPress site with Next.js. I can't get past step two: https://faustjs.org/docs/tutorial/learn-faust/#2-set-up-headless-wordpress-...
0
votes
0
answers
74
views
403 PERMISSION_DENIED on Route Optimization API from Firebase App Hosting Despite Correct IAM & API Setup
Problem Description:
I am developing a Next.js application deployed on Firebase App Hosting. The application calls the Google Cloud Route Optimization API from a Server Action.
Despite carefully ...
-1
votes
0
answers
54
views
How do I get logged-in user's likes in historical order using API v1?
I want:
Logged in users liked tracks in the order the user liked them.
Tried:
Use v2 API but i cant get OAuth to work without internal ID.
User history to get dates user liked tracks on, doesnt ...
1
vote
1
answer
66
views
Next.js 15 App Router — POST /api/contact returns 404 even though route.ts exists
I’m using Next.js 15 with the App Router. I created an API route for a contact form, but when I submit the form, I get:
POST /api/contact 404
My project structure:
src/
app/
contact/
page....
0
votes
0
answers
48
views
Cloudinary error: "Customer is marked as untrusted" or "Blocked for delivery" when accessing uploaded PDF files
I’m using Cloudinary to upload documents (PDFs, ZIPs, etc.) from my Next.js app.
The upload succeeds, but when I try to access the file via URL like:
In the Cloudinary Media Library, it says:
Access ...
0
votes
0
answers
169
views
Next.js 16 Partial Prerendering (PPR) + Cache Components: Why is my dynamic segment not streaming after first request?
I'm experimenting with Next.js 16's new Cache Components and Partial Prerendering (PPR) to build a product page that:
Serves a static shell instantly (HTML for layout, header, footer)
Streams the ...
-1
votes
0
answers
60
views
Using mutate inside debounce not triggering the API call?
export function useDebounce<T extends (...args: Parameters<T>) => void>(
callback: T,
delay = 300,
dependencies: React.DependencyList = []
): (...args: Parameters<T>) => ...
1
vote
0
answers
61
views
Module not found: Can't resolve # when using turborepo with nextjs and `imports`
I have a monorepo built with turborepo. Packages compilation works fine but there is an error when I try to build entire monorepo including my nextjs app. This is my package.json and tsconfig.ts of my ...
1
vote
1
answer
148
views
Next.js 16 Cache Components: Why is my cache() function still hitting the database on every request despite using next: { revalidate: 3600 }?
I'm using Next.js 16 with Cache Components (cache() from React) to deduplicate and cache database queries across layouts and pages.
Here's my setup:
// lib/data.ts
import { cache } from 'react';
...
3
votes
2
answers
241
views
Radix UI's global CSS cannot be overridden with TailwindCSS utilities - only with !important
I'm using ShadCN UI, Radix UI with TailwindCSS v4. I noticed that Tailwind classes don't work unless I add !important. For example:
<section className="bg-gray-100 !px-15 !pt-15 !pb-20 rounded-...
Best practices
0
votes
0
replies
51
views
Why does my Next.js app’s performance drop significantly when using dynamic routes with large datasets and server-side rendering (SSR)?
I'm working on a Next.js 14 app with several dynamic routes (e.g., /product/[id]) that render product details from a large dataset (around 50k+ records) stored in PostgreSQL.
I'm using ...
0
votes
0
answers
52
views
Next.js 15 Middleware: "Cannot find the middleware module" error with NextAuth.js
I'm implementing authentication middleware with NextAuth.js in Next.js 15.3.2 using the App Router. The middleware compiles successfully but throws a runtime error when trying to access protected ...
6
votes
5
answers
5k
views
Error: "PrismaConfigEnvError: Missing required environment variable: DATABASE_URL"
I’m working on a Next.js + TypeScript project with a MySQL database using Prisma.
I set up my configuration in prisma.config.ts like this:
import { defineConfig, env } from "prisma/config";
...
0
votes
0
answers
53
views
Why does generateStaticParams() in Next.js App Router make a page static (SSG) instead of server-rendered (SSR)?
I’m using the Next.js App Router and trying to understand how rendering type is decided.
In my page, I have both generateStaticParams() and a server component that fetches data:
export async function ...
1
vote
0
answers
22
views
Easypaisa integration returns "Request Rejected" instead of redirecting or processing payment
Easypaisa integration returns "Request Rejected" instead of redirecting or processing payment
this is title and
I'm integrating Easypaisa Payment Gateway with a Next.js (App Router) ...
0
votes
2
answers
58
views
Next.js build hangs after printing environments
When trying to build a Next.js project, it hangs forever after outputting:
▲ Next.js 15.YY.ZZ
- Environments: .env
It won't make it to "creating optimized build" as described in other ...
1
vote
1
answer
88
views
How to make server actions work seamlessly with Zustand state updates in client components?
I was working on Next.js 15 (App Router) and trying to integrate Server Actions with Zustand for client-side state management.
// store.ts
import { create } from 'zustand';
export const ...
0
votes
1
answer
76
views
IDs are mismatched when calling Spring Boot REST API from Next.js client generated using OpenAPI/Swagger
I have a Spring Boot Data REST project with the following classes
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Product {
@Id
private String sku;
@OneToMany(...
-1
votes
1
answer
115
views
Dynamic Number Insertion using Ringba is not replacing clickable tel: links
I am using Ringba (https://www.ringba.com/) for Dynamic Number Insertion (DNI) in my React/Next.js web app.
Context
Parts of my website have this structure to display a phone number to call:
import ...
4
votes
0
answers
137
views
Hydration failed when synchronously instantiating a WebAssembly module inside a client component [closed]
I came across surprising hydration mismatch in a Next.js 15 App Router app when I synchronously instantiate a small WebAssembly module during the render of a client component.
Server builds fine.
On ...
1
vote
0
answers
57
views
Unable to complete Amplify v6 Cognito OAuth flow in my Next.js App
I am using Amplify and Cognito's hosted UI Login page to handle my user authentication. I am able to redirect to the cognito hosted page, enter my user credentials, and redirect page to my sign in ...
0
votes
0
answers
207
views
How to create a multi-step form in NextJS with @tanstack/form
I have recently migrated my project from react-hook-form (rhf) over to @tanstack/form and for the most part have really enjoyed the implementation. One issue I have encountered and cannot find a ...
0
votes
0
answers
53
views
How to automatically convert FormData types in Next.js Server Actions without manual parsing?
I'm using Next.js 14 with Server Actions and I'm tired of manually parsing and converting FormData values. Every action looks like this:
'use server'
export async function createUser(formData: ...
0
votes
1
answer
52
views
Browser text selection highlight disappears when showing custom toolbar on selection
I have a reader page where I show a floating toolbar after the user selects text. When the toolbar appears, the browser's native selection highlight (the blue/OS-specific highlight) disappears, making ...
1
vote
0
answers
54
views
How to get permissions for task "contactExporterTasks"
Hey guys I have a next's project tied with supabase. And as auth system I use LinkedIn.
const { data, error } = await supabase.auth.signInWithOAuth({
provider,
options: {
...
0
votes
0
answers
54
views
Chakra UI v3 className="dark" not overriding color mode
The Chakra UI docs, https://chakra-ui.com/docs/styling/dark-mode, state the following:
To force dark mode, set the dark className on any parent element, or the root element of your application.
<...
0
votes
0
answers
47
views
Google Rich Results: Missing field image, description, and invalid price in Product structured data
Problem Description:
I have a Next.js / React product page where I tried to generate JSON-LD structured data for Google Rich Results like this:
<script
type="application/ld+json"
...
1
vote
1
answer
343
views
How do I use the built-in MCP server in Next.js 16 and configure next-devtools-mcp? [closed]
I'm exploring the new MCP (Model Context Protocol) server introduced in Next.js 16, and I’d like to understand how to properly enable and use it in a development environment.
What I’ve done so far:
...
0
votes
1
answer
388
views
create an new app with the latest version of nextjs
I recently wanted to create a new nextjs project, so I used:
npx create-next-app@latest my-app.
I cd'd into the my-app folder and hit yarn to install dependencies, and starting the project produced an ...
0
votes
1
answer
61
views
NextAuth Google Login Redirect to Localhost instead of Production Domain
I am doing a project which will use Google Login in NextJs
This is my setting in OAuth 2.0
and in amplify environment variables
After I deployed the app and try to login
It redirect me to http://...
0
votes
0
answers
56
views
How to persist data using PrismaAdapter and Authjs
I am trying to persist user data using PrismaAdapter with authjs. But getting following error.
[auth][details]: {}
[auth][error] SessionTokenError: Read more at https://errors.authjs.dev#...
2
votes
1
answer
80
views
Should I close the DB connection in NextJS
I am new to programming (and NextJS) and I'm building a NextJS app, using Mongoose for my MongoDb connection. I was wondering if I should close the connection after each query? Right now I am just ...
0
votes
1
answer
32
views
Why session token still has expiry date?
NextJs + BetterAuth
Why session token still has expiry date no matter what I do?
Example of auth.ts:
export const auth = betterAuth({
database: new Database("./sqlite.db"),
...
0
votes
1
answer
88
views
Windows 11 build fails for Electron + Next.js: missing @img/sharp-darwin-arm64
I'm developing a project using Next.js 15.5.4 inside an Electron.js application, with the following stack:
React.js
Tailwind CSS
SQLite
On Windows 11, running npm run build (or next build) ...
0
votes
0
answers
114
views
Need help: "2 Unkown: Getting metadata from plugin failed with error: Could not refresh access token: Request failed with status code 500"
I have begun creating an application (Next.JS running on Firebase App Hosting) in Firebase Studio using Gemini and everything was working fine until now that I got a notification about "Client ...
0
votes
0
answers
45
views
When calling the same server action on the client side, the second request disappears
I have a request which its get wallet details in server action. First request is working properly. But after user changes, I can see log top of it but its not entering server action. For example:
...
0
votes
1
answer
60
views
Implementing cache for server actions
I'm new to caching, if I understand correctly, with caching, a database query would only run once for a specific amount of time (e.g. 1 hour) until it's revalidated, but I read server actions are not ...
-1
votes
1
answer
120
views
How to use Prisma with Neon Serverless from Vercel? [closed]
I'm trying to use Prisma with neon/serverless from vercel. When I run npm run dev, I get this error message:
Argument of type 'Pool' is not assignable to parameter of type 'PoolConfig'.
Types of ...
0
votes
1
answer
106
views
Youtube embed video only loads on a fresh page load in next js
Using the react-youtube package, I'm displaying a series of youtube videos on iframes. It works when the page is navigated from an outside url or on a page refresh. However, the videos don't load when ...
0
votes
0
answers
113
views
How to avoid double login when using NextAuth (GitHub provider) with Giscus comment system?
We’re a small student-led open-source learning platform: "involutionhell" built by volunteers in our spare time. Our website uses NextAuth.js with a GitHub provider for authentication.
...
0
votes
2
answers
103
views
React Query Server Side Rendering
I have been using react query and next.js , I need to know how can achieve server side rendering using react query, I can achieve with this using normal fetch or axios in the server side components, ...
1
vote
0
answers
33
views
Loading.js doesn't show when navigating between pages
I want to show some cool page spinner when navigating between pages so the spinner shows until page content is loaded, i have page.js, layout.js and loading.js under app/(home)/. but loading.js is not ...
1
vote
1
answer
83
views
How to make the body start ignore the safe area on iOS 26.1 (Safari)
I want to make a page start from the screen top to the bottom. That is the green area under the top status bar and bottom IP address bar.
Here is the source code repository:
https://github.com/...