next.js
742b1866 - Ready in X - prints wrong timing on dev server restart (#90874)

Commit
1 day ago
Ready in X - prints wrong timing on dev server restart (#90874) ### What? Fixes the "Ready in" printout for the Next.js dev server after restarts. ### Why? When the dev server restarts (e.g., due to `next.config` changes), the "Ready in" time was incorrect, showing the total process uptime instead of the actual startup duration for the newly restarted server instance. This was because `NEXT_PRIVATE_START_TIME` was not reset. ### How? `process.env.NEXT_PRIVATE_START_TIME` is now updated to `Date.now().toString()` in `packages/next/src/cli/next-dev.ts` right before `startServer()` is re-called when handling a `RESTART_EXIT_CODE`. This ensures the "Ready in" time accurately reflects the startup duration from the point of restart. The tricky part has been writing a test, that both catches a regression, and won't be flaky on CI. After some back and forth, I think the Vercel bot suggestion is probably the simplest. --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Joseph Chamochumbi <joseph.chamochumbi@vercel.com> Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com> Co-authored-by: icyJoseph <sephxd1234@gmail.com>
Author
Parents
Loading