72 questions from the last 30 days
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
1
answer
651
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: ...
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-...
Best practices
0
votes
2
replies
88
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 ...
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
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 ...
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-...
-1
votes
2
answers
145
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 ...
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';
...
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 (
<...
Best practices
1
vote
3
replies
111
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&...
1
vote
1
answer
71
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
1
answer
64
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
vote
1
answer
70
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....
2
votes
1
answer
71
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 ...
2
votes
1
answer
78
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
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 ...
0
votes
1
answer
55
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 ...
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
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 ...
-1
votes
0
answers
50
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 ...
-4
votes
1
answer
61
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
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
1
answer
79
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, ...
-1
votes
0
answers
73
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 ...
1
vote
0
answers
42
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 ...
-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 ...
-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 ...
-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 ...
-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,...
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 ...
-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&...
1
vote
0
answers
69
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 ...
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 ...
-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)...
0
votes
1
answer
59
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 &...
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 ...
-1
votes
0
answers
43
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. ...
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 ...
-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>) => ...
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 ...
-1
votes
0
answers
30
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)
- ...
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
vote
1
answer
88
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 ...
0
votes
1
answer
56
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}`...
0
votes
0
answers
52
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 ...
-6
votes
0
answers
30
views
How to view pdf,xlsx,docx,ppt in nextjs from s3 getobject url [closed]
My s3 url is getobject url - .pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=&X-Amz-Date=&X-Amz-Expires=&X-Amz-Signature=&X-Amz-...
Best practices
0
votes
3
replies
39
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. ...
0
votes
1
answer
45
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
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 ...