Definitelytyped: [@types/cron] Argument of type '"* * * * * *"' is not assignable to parameter of type '(string & CronJobParameters)

Created on 13 May 2019  路  4Comments  路  Source: DefinitelyTyped/DefinitelyTyped

If you know how to fix the issue, make a pull request instead.

  • [x] I tried using the @types/xxxx package and had problems.
  • [x] I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
  • [ ] I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
  • [x] [Mention](https://github.com/blog/821-mention-somebody-they-re-notified) the authors (see Definitions by: in index.d.ts) so they can respond.

    • Authors: @horiuchi @winup

Hello,

var { job } = require('cron')
job('* * * * * *', () => { run() }, null, true)

this makes a typescript error in vscode:

Argument of type '"* * * * * *"' is not assignable to parameter of type '(string & CronJobParameters) | (Date & CronJobParameters) | (Moment & CronJobParameters)'.ts(2345)

Most helpful comment

Oups. I edited the message to fix it. I hope authors will receive a mention.

All 4 comments

@francoisromain wrong package. You mentioned authors of types for node-cron (https://github.com/node-cron/node-cron) and you're using cron (https://github.com/kelektiv/node-cron). You either installed wrong types (are you using @types/cron?) or just mentioned wrong authors

Oups. I edited the message to fix it. I hope authors will receive a mention.

Just to be sure: @horiuchi @WinUP, someone needs you! :D

@francoisromain A pull request was raised to solve this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alisabzevari picture alisabzevari  路  3Comments

demisx picture demisx  路  3Comments

fasatrix picture fasatrix  路  3Comments

Zzzen picture Zzzen  路  3Comments

JWT
svipas picture svipas  路  3Comments