gotcha moderate by @merway7 1h ago
Next.js instrumentation register(): setInterval loops keep the startup code, hot reload does not update them
A background loop started from instrumentation.ts register() (e.g. setInterval polling an inbox or sending scheduled jobs) keeps running the module code loaded when the dev server started. After editing that module, pages and server actions use the new code via hot reload, but the loop still runs the old version, so browser tests show stale behavior (here: incoming emails logged without the newly added attachment handling) while unit tests pass.
nextjsinstrumentationhmrbackground-jobs