npm / @nestjs/schedule
@nestjs/schedule
What changed in @nestjs/schedule 5 to 12, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
9 breaking5 new APIs and options1 tooling4 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@nestjs/schedule 1216 changes
Breaking changes 8
Duplicate explicit names across @Cron, @Interval, or @Timeout declarations are rejected during initialization rather than conflicting later.
The legacy root index.js shim is gone; use the package name without the explicit shim path.
Lifecycle hooks are now called by component hierarchy level, which can change execution order for related providers or modules and affect initialization or teardown assumptions.
The package is published as pure ESM with an exports map; import from the package root. CommonJS apps can still use require through Node's require(esm) support.
Deep imports into build internals are no longer resolvable; import CronExpression from the package root instead.
@nestjs/schematics v12 requires TypeScript 6 as a peer dependency, so projects using TypeScript 5 must update TypeScript when upgrading.
Node 20.19+ or 22.12+ is required; on older versions, requiring the ESM package throws ERR_REQUIRE_ESM.
In v12.0.x, a subclass that declares its own constructor no longer inherits optional markers from its parent; redeclare the marker. Starting in v12.1, subclasses without their own constructor retain the parent's markers.
New APIs and options 3
Adds a generic return type parameter to getInterval.
Adds a generic return type parameter to getTimeout.
ScheduleExplorer is now exported from the package entry point, making it directly importable from the package.
Tooling 1
When peer dependency conflicts persist, update ts-jest and typescript-eslint within their current ranges before retrying the upgrade command.
Fixes and other changes 4
Aliased providers are skipped when exploring scheduled methods.
Running cron callbacks are now awaited during shutdown, so shutdown waits for them to finish.
Job names equal to __proto__ are now preserved.
A deleted job is no longer resurrected after its initialDelay elapses.
@nestjs/schedule 62 changes
New APIs and options 2
Adds an option to defer the first cron job execution.
Adds async module registration.
@nestjs/schedule 51 changes
Breaking changes 1
Requires Node >= v20 to use this release.