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?
