404 Error on Sign-In Form After next build in Standalone Mode
Answered
Black Caiman posted this in #help-forum
Black CaimanOP
I'm running a Next.js 15 app that works fine in development mode. After building it with next build (output: standalone) and running the server (node .next/standalone/server.js), the middleware correctly intercepts requests and redirects to /auth/sign-in, as expected.
However, in production mode, the app triggers a 404 (not-found.tsx), but not in the HTTP response. I can see the page loading in the browser, but something internally thinks it's a 404. This does not happen in development mode.
How can I debug this issue and identify what route is causing the 404? Any ideas on how to fix it?
However, in production mode, the app triggers a 404 (not-found.tsx), but not in the HTTP response. I can see the page loading in the browser, but something internally thinks it's a 404. This does not happen in development mode.
How can I debug this issue and identify what route is causing the 404? Any ideas on how to fix it?
Answered by Black Caiman
Find the root cause.
I got 2 breadcrumbs: 1 for my app and 1 for auth
- /(dashboard)/@breadcrumbs
- /auth/@breadcrumbs
Yes they have the same name, next build create the both directories.
But don't know why, maybe related to parallel routes, at non development runtime nextjs do not find /auth/@breadcrumbs.
But I rename /auth/@breadcrumbs to /auth/@authbreadcrumbs.
Now its works

I got 2 breadcrumbs: 1 for my app and 1 for auth
- /(dashboard)/@breadcrumbs
- /auth/@breadcrumbs
Yes they have the same name, next build create the both directories.
But don't know why, maybe related to parallel routes, at non development runtime nextjs do not find /auth/@breadcrumbs.
But I rename /auth/@breadcrumbs to /auth/@authbreadcrumbs.
Now its works

1 Reply
Black CaimanOP
Find the root cause.
I got 2 breadcrumbs: 1 for my app and 1 for auth
- /(dashboard)/@breadcrumbs
- /auth/@breadcrumbs
Yes they have the same name, next build create the both directories.
But don't know why, maybe related to parallel routes, at non development runtime nextjs do not find /auth/@breadcrumbs.
But I rename /auth/@breadcrumbs to /auth/@authbreadcrumbs.
Now its works

I got 2 breadcrumbs: 1 for my app and 1 for auth
- /(dashboard)/@breadcrumbs
- /auth/@breadcrumbs
Yes they have the same name, next build create the both directories.
But don't know why, maybe related to parallel routes, at non development runtime nextjs do not find /auth/@breadcrumbs.
But I rename /auth/@breadcrumbs to /auth/@authbreadcrumbs.
Now its works

Answer