Next.js Discord

Discord Forum

parallel route doesn't navigate back properly

Unanswered
Alligator mississippiensis posted this in #help-forum
Open in Discord
Alligator mississippiensisOP
I'm having a really strange issue in my nextjs 15 application:

I have a @modal parallel route for displaying modals in my application, like in the print attached

the modals are at /app/track/suspensions/@modal/flasks/add/page.tsxand /app/track/suspensions/@modal/batches/add/page.tsx

the problem is:

when I close these modals in a production environment, it goes to a clientside error page instead of opening it

if I try opening it in the development server of npm run dev it works normally

in this page.tsx file that I'm sharing goes the add batch form modal

you can see that I use router.back() to return

what might be happening?

I also attached a print with the error screen and my console error

my default.tsx is empty like this:
export default function Default() {
  return null;
}

1 Reply

Alligator mississippiensisOP
also my layout.tsx inside /suspensions is pretty simple

import { ReactNode } from 'react';

export default function TrackSuspensionsLayout({
  children,
  modal, // ← the “@modal” parallel‐route slot
}: {
  children: ReactNode;
  modal: ReactNode;
}) {
  return (
    <>
      {modal}
      {children}
    </>
  );
}