Closed mudlee closed 1 year ago
Please provide a minimum reproduction repository (Git repository/StackBlitz/CodeSandbox project).
Got the same issue. Wonder how to deal with it. (@nestjs/common version: 8.4.7, cron version: 2.0.0)
/app/node_modules/cron/lib/time.js:271 Time Zone: ${zone || '""'} - Cron String: ${this} - UTC offset: ${date.format( ^
TypeError: date.format is not a function
at CT._getNextDateFrom (/app/node_modules/cron/lib/time.js:271:79)
at CT.sendAt (/app/node_modules/cron/lib/time.js:185:17)
at CT.getTimeout (/app/node_modules/cron/lib/time.js:202:29)
at CJ.start (/app/node_modules/cron/lib/job.js:118:31)
at Timeout.callbackWrapper [as _onTimeout] (/app/node_modules/cron/lib/job.js:171:11)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7)
npm notice
npm notice New minor version of npm available! 8.5.0 -> 8.19.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.19.2
npm notice Run npm install -g npm@8.19.2
to update!
npm notice
@Techevan please provide some project that reproduces that issue.
@micalevisk https://stackblitz.com/edit/nestjs-typescript-starter-apu3jw?file=README.md
You can see that toDate
and format
are undefined.
cc @kamilmysliwiec
Please report this issue in this repository https://github.com/kelektiv/node-cron
Is there an existing issue for this?
Current behavior
We have a NestJS application which uses
@nestjs/schedule
, version2.1.0
. For deployment we use Docker images. For almost all of our deployments it works just fine. One of the client reported though, that on their onprem, the app stopped with the following error:We have multiple
@Cron
annotations in our codebase, but all looks the same:I searched for this error, and found some similar at https://github.com/kelektiv/node-cron/issues, but those are not same, but I would say, very similar, and relates to the same bug.
What can I do? What the NestJS team will do?
Minimum reproduction code
....
Steps to reproduce
No response
Expected behavior
I would expect even if the cron fails, it would not stop the whole application.
Package version
2.1.0
NestJS version
9.0.0
Node.js version
16
In which operating systems have you tested?
Other
No response