75 questions from the last 30 days
6
votes
4
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";
...
1
vote
1
answer
279
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:
...
3
votes
2
answers
218
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
vote
1
answer
116
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
1
answer
101
views
ScrollTrigger not working after route navigation in Next.js (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
79
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
3
answers
65
views
why nextjs is sending async prop from a component to a suspended child component
import {Suspense} from "react"
type Props = {
params: Promise<{joblistingId: string }>
}
export default function JoblistingPage(props: Props) {
return (
<...
2
votes
1
answer
49
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
63
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
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
1
answer
74
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
0
answers
53
views
Why does Atomics.waitAsync() inside a Web Worker cause the Edge Runtime in Next.js 15 middleware to hang indefinitely?
I was testing how Next.js 15 (App Router) behaves when using Atomics.waitAsync() inside a Web Worker, executed from Edge Middleware.
The worker runs fine in a standard Node.js environment, but when ...
-1
votes
0
answers
57
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 ...
-3
votes
1
answer
61
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
vote
1
answer
39
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 ...
0
votes
0
answers
300
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 ...
Best practices
1
vote
1
replies
39
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&...
Best practices
0
votes
0
replies
42
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
49
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.
<...
-2
votes
0
answers
35
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)...
1
vote
1
answer
39
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
50
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
47
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
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
68
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 ...