98 questions
0
votes
1
answer
57
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
0
answers
26
views
Next.js not showing loading.tsx while static route is loading
Other similar questions didn't solve my problem. I have a route like:
export default async function PromptListPage() {
const prompts: PromptListItem[] = await fetchPromptsFromDB();
return (
&...
0
votes
0
answers
34
views
How to Implement Optional Route Parameters in Next.js 15.5.0 App Router Without Making Them the Last Segment?
I'm developing an application using Next.js 15.5.0 with the App Router. My desired URL structure is:
/[locale]/[workspace] (without a project)
/[locale]/[workspace]/[project] (with a project)
...
0
votes
0
answers
15
views
If cacheTag is used inside a forEach loop, will the returned data be cached within that functional scope? (Next.js 15 Canary)
I am currently using the Canary version of Next.js 15 to develop a project under the guidance of an instructor. I understand the general concept of using cacheTag to cache returned data. However, I am ...
1
vote
0
answers
64
views
Next.js 15.5:"Cookies can only be modified in a Server Action or Route Handler” when trying to set cookies inside a TypeScript Axios library
I’m developing a TypeScript library that handles authentication using Axios.
The library automatically refreshes tokens (access_token and refresh_token) and needs to save them in cookies so the user ...
0
votes
1
answer
69
views
AWS Amplify Gen 2 runtime env vars not available at SSR, causing undefined errors
Major issues
I have a Next.js application that previously ran without issues on Vercel. However, upon deploying it to AWS Amplify, I encountered a 500 Internal Server Error. Based on the CloudWatch ...
0
votes
0
answers
373
views
How to send file input (PDF/Excel) to OpenRouter Chat Completions API?
I’m building a Next.js API route to connect with the OpenRouter Chat Completions API.
For text-only messages, everything works fine. For images, sending them as image_url also works:
content: [
{ ...
0
votes
0
answers
38
views
loading.tsx and React Suspense are not triggered for _rsc requests in Next.js 15.2.1
I'm using Next.js 15.2.1 with the App Router.
I noticed that when I navigate to a page, my loading.tsx file is not triggered, and neither is React Suspense, if the page makes an _rsc request.
For ...
1
vote
0
answers
132
views
Next.js error: Cannot read properties of null (reading 'parentNode')
I'm getting this error in NextJS (15.3.4) randomly while in dev mode, it often occurs when navigating from one page to another, but I can't seem to reproduce consistently. It seems like an issue with ...
0
votes
1
answer
82
views
Clerk + Sanity integration issue w/ Next.js
Using Next.js (15.2.4), Clerk Auth, and trying to integrate Sanity as a CMS into the application. After installing Sanity and hitting /studio, this error appears:
Error: Clerk: auth() was called, but ...
0
votes
0
answers
44
views
Handling Invalid Login Errors in AWS Cognito with Auth.js (Formerly NextAuth) using SRP Authentication Flow
I'm working on creating a custom login and sign-up page using AWS Cognito with the SRP (Secure Remote Password) authentication flow. For handling the session, I’m using Auth.js (previously NextAuth), ...
1
vote
1
answer
120
views
The parent DOM element of the datagrid has an empty height [duplicate]
After I recently upgraded my MUI X packages. I see the following error:
MUI X: useResizeContainer - The parent DOM element of the Data Grid has an empty height.
Please make sure that this element has ...
0
votes
0
answers
200
views
How to correctly configure eslint-plugin-import in Next.js 15 with TypeScript and path aliases?
I'm working with a Next.js 15 project using TypeScript, and I'm trying to properly configure eslint-plugin-import to work with path aliases (like @/), as well as import sorting and unresolved path ...
0
votes
0
answers
23
views
Programatically run next build and next start
I have a application configuration page that would save certain parameters for the site in the .env. At this point point the application needs to be rebuilt, but I dont want to have to go the server ...
1
vote
0
answers
53
views
Tab groups inside a modal with parallel & intercepting routes
In Next.js 15, when using Parallel Routes together with Intercepting Routes, is it possible to have Tab Groups inside a Modal?
In my case, when the user clicks a link on the homepage (or any other ...
0
votes
0
answers
166
views
How to set up client (browser) msw worker in NextJS 15
I've been trying to setup Mock Service Worker in my NextJS 15 app (App Router) and faced problems with my client workers.
Here are my files with setupWorker/setupServer:
@src/shared/api/mocks/server....
1
vote
1
answer
165
views
Next.js 15: Unable to serve static audio file from public directory
Problem Description
I'm trying to play an MP3 audio file in my Next.js 15 application, but the audio files in the public/audio/ directory are not being served. When I check the browser's developer ...
-3
votes
1
answer
81
views
Problem: Type '{ id: string; }' is missing the following properties from type 'Promise<any>
I'm currently facing a TypeScript type error when using a dynamic API route in Next.js v15.3.3, with:
TypeScript: ^5
React: ^19.0.0
When I try to compile, I receive this error:
Type error: Type '{ ...
-1
votes
0
answers
107
views
Hot reload problem in NextJs15.3 + Traefik
I have a multi-container application (database, clientside, serverside and traefik). When I simply up project and expose 3000 port for clientside and access it in browser (localhost:3000) it works ...
0
votes
2
answers
314
views
Issue with Next.js 15.13 with promises and params
Writing a dynamic api route for page that accepts [slug] params.
export async function GET(request: NextRequest, { params }: { params: Promise<{ slug: string}> }) {
const {slug} = await ...
0
votes
0
answers
31
views
How to fetch session in RootLayout/Header without making the whole app dynamic?
I'm building an ecommerce site using Next.js App Router (v13+). About 80% of my pages are static and ideally should remain static for performance and caching benefits.
However, when I fetch the user ...
0
votes
0
answers
74
views
Hydration failed: Server rendered HTML does not match the client when using i18next in Next.js 15 with SSR
I'm building a Next.js 15.1.2 app using React 18.3.1 and I integrated i18n support with the following packages:
[email protected]
[email protected]
[email protected]
i18next-http-...
1
vote
2
answers
168
views
Error occurred prerendering page TypeError: Cannot read properties of null
I'm trying to deploy a blog written with Next.js v15.3.3 with Vercel but I keep getting the same error:
Error occurred prerendering page "/post/1". Read more: https://nextjs.org/docs/...
0
votes
0
answers
63
views
Next.js metadata og image issue on facebook
I'm working on a Newspaper site. In this website under [slug]/page.tsx On generateMetadata function, i'm generating and showing it properly but on facebook it's not working;
Here is the function code-
...
0
votes
0
answers
192
views
TailwindCSS styles from shared packages/ui are not applying in Next.js 15 + Turbopack app (Turborepo monorepo) [duplicate]
I'm building a Turborepo monorepo with this stack:
Next.js 15
Turbopack (Next.js 15 default)
TailwindCSS 4
packages/ui: a shared React component library (published locally with import alias @waspos/...
0
votes
1
answer
25
views
Next.js SSR/CSR App Loads Blank on Some Devices (No Errors in Console) | runs complety good on Some
I developed a Next.js (App Router) e-commerce web app with:
Pages rendered via SSR (components a mix of CSR and SSR)
Dynamic routes
MUI used throughout (CSR and SSR)
No HTTP caching
Redux-Toolkit + ...
1
vote
1
answer
73
views
How to get current route (or requested URL) on server component?
Using Next.js 15 with app router.
On a method called from a page.tsx file, how do I see the route it belongs to, or alternatively the URL requested?
(I know about the middleware header hack, but that ...
1
vote
1
answer
48
views
Only plain objects can be passed to Client Components from Server Components (i18next + dynamic import)
I'm working on a Next.js app with App Router and I'm implementing localization using i18next with dynamic JSON imports for translations. I'm running into the following error:
Error: Only plain objects,...
0
votes
1
answer
85
views
How to keep textbox (HTML input) above keyboard in mobile in ReactJS?
I am trying to clone WhatsApp's biggest issue in UI is my aligning my textbox above keyboard in mobile please help!
This is how I tried to implement it, but it's not great—it's buggy and not smooth
&...
0
votes
0
answers
179
views
Error "Catch-all must be the last part of the URL" with Parallel Routes and catch-all routes in Next.js
Problem
In Next.js (version 14+), I'm working with Parallel Routes using the @ prefix and catch-all routes [...category]. My file structure is:
app/
[...category]/
@view_category/
...
1
vote
1
answer
116
views
React Awesome Reveal not working in Next.js 15 + TypeScript + Material UI setup
I'm trying to use react-awesome-reveal for animations in my Next.js 15 project, which also uses TypeScript and Material UI. I've followed the documentation carefully:
Installed the necessary packages:...
0
votes
1
answer
40
views
Next.js Build error: I have customize the fetch to retrieve token from both client and server
I have customized the fetch in a Next.js app to get the token whenever a request is made. This is the function:
import { getNewAccessToken } from "./getNewAccessToken";
import { cookies } ...
1
vote
1
answer
2k
views
How to config Hero UI with TailwindCSS v4
Here are the details:
Next.js v15.x
TailwindCSS v4.x
Hero UI: latest
Tailwind classes work but Hero UI not showing styling at all.
package.json
{
"dependencies": {
"@heroui/...
2
votes
0
answers
115
views
Code Splitting With Dynamic Routes in Next.js
I'm working on a project using Next.js 15 with the App Router and dynamic routes. I've encountered an issue where JavaScript and CSS are not being split into separate chunks as expected when using ...
0
votes
0
answers
60
views
Problem with image caching on NextJS 15 and local storing
Im making a Video Frame Classifier with React(frontend) and Flask(backend). For this task I made a little interface where you can move between frames. The screen showed only one frame or image in ...
3
votes
1
answer
3k
views
Why aren't my custom styles from tailwind.config.ts applied in a Next.js 15 project with tailwindcss 4.1.3?
I ran into an issue with a new Next.js 15 project.
I created it using and selected the option to set up Tailwind CSS 4.1.3. After the project was installed, I noticed that the file was missing. ...
0
votes
2
answers
575
views
TypeError: (0 , {imported module [project]/auth.ts [app-rsc] (ecmascript)}.auth) is not a function
Now i understand that this error is on server side but i just don't know how to fix this
I m using Auth JS and GitHub as a provider
here is the code for Navbar.tsx
```import Link from 'next/link'
// ...
0
votes
2
answers
51
views
next.js <Image/> inconsistency - not always displaying images
I have this weird issue with Images - they sometimes display as expected, but more often I get only the browser placeholder instead of the image.. regardless of static vs dynamic import they all do ...
0
votes
0
answers
20
views
Razorpay's Blade Design System with Next.js for Server Side Rendering
I am new to Javascript and its frameworks. I am exploring Next.js for my complex website with SEO implications. I want to use Razorpay's Blade design System for it.
I am not able to use Blade's ...
0
votes
1
answer
79
views
how can i access my session in an api-route in NextAuth Auth.js Next.js 15?
I use NextJS 15 and Auth.js / NextAuth with the App Router.
I would like to protect my API route so that you can only gain access with the appropriate role. I would like to find this out from the ...
0
votes
0
answers
56
views
NextJS Catch-all Segments not working on vercel
NextJS Catch-all Segments not working on Vercel Now I'm learning to use next.js ver.15 with express it shows 404 Notfound but when I try on my pc in localhost it works fine now I don't know how to fix ...
1
vote
1
answer
463
views
How to fix 'Component page doesn't exist.' in Storyblok and Next15 project
I followed the Storyblok documentation and have the exact same files.
https://www.storyblok.com/mp/announcing-react-sdk-v4-with-full-support-for-react-server-components
But I still get the server ...
0
votes
0
answers
71
views
How to Integrate Django Djoser Backend with Next.js Frontend Using Auth.js?
I am building authentication with:
Backend: Django (DRF) + Djoser for JWT authentication.
Frontend: Next.js using Auth.js (NextAuth) for authentication.
I want users to log in via Next.js, ...
0
votes
3
answers
306
views
Next.js - router.push with scroll: false still scrolls
I am attempting to add parameters to the URL after navigating to the current page using router.push. However, I don't want the page to scroll to the top after the parameters are added. To prevent this,...
0
votes
2
answers
264
views
Hydration failed because the server rendered HTML didn't match the client error in usage with shadcn-ui card component
I am getting this error when I call shadcnui's card component in my next js 15 application. Here are my codes ;
import {
Card,
CardContent,
CardFooter,
CardHeader,
CardTitle,
} from "./ui/card&...
0
votes
0
answers
97
views
Hydration error only at Telegram's web view
I am getting a hydration error in my project, but it is appearing only in the telegram. I tried to open it from Safari, chrome, and Opera in my locale and also in production. There is no error. But ...
0
votes
1
answer
112
views
Next.js App Router "sync-dynamic-apis" Error in Dynamic Route Page Component
I'm getting a "sync-dynamic-apis" error in my Next.js App Router dynamic route component, despite following what seems like the correct pattern. The page renders correctly in the browser, ...
4
votes
3
answers
698
views
NextJS 15 Build Error occurred prerendering page "/404"
when running NODE_ENV=developement npm run build in nextjs project, there is the following error,
Error: should not be import outside of pages/_document.
Read more: https://nextjs.org/docs/messages/...
1
vote
1
answer
369
views
PWA Why are service workers not visible under the Application tab in Chrome for Next.js 15?
I am learning Progressive Web App (PWA) development in Next.js and using the @ducanh2912/next-pwa package.
Setup:
Next.js version: 15.0.4
PWA package: @ducanh2912/next-pwa
I have configured my next....
1
vote
0
answers
52
views
Client component not getting rendered on first load in NextJS
I am new to NextJS and I was just trying things and I noticed that my dropdown component was not working as expected on the first load and I do not understand why that is happening. Basically, when I ...