bree icon indicating copy to clipboard operation
bree copied to clipboard

TypeError: cron is not a function

Open gutenye opened this issue 8 months ago • 3 comments
trafficstars

Describe the bug

Node.js version:

OS version:

Description:

cron-validation released a new 1.5.0 version 4 days ago

Need to change

const cron = require('cron-validate');

to

const { default: cron } = require('cron-validate');

Actual behavior

Expected behavior

Code to reproduce

Checklist

  • [ ] I have searched through GitHub issues for similar issues.
  • [ ] I have completely read through the README and documentation.
  • [ ] I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.

gutenye avatar Mar 17 '25 09:03 gutenye

in my case, i'm using "cron-validate": "1.4.5", for temporary i hope fixed version will be released soon. 🙏

kimjoin2 avatar Mar 17 '25 16:03 kimjoin2

Using cron-validate 1.4.5 did the trick. I added this to package.json: "overrides": { "cron-validate": "1.4.5" } This way, npm override the version 1.5.x from bree with 1.4.5.

diggler1986 avatar Mar 24 '25 21:03 diggler1986

We ended up using patch-package and modified the import of the cron-validate library

-const cron = require('cron-validate');
+const cron = require('cron-validate').default;

jc99ta avatar Jun 17 '25 14:06 jc99ta

i had the same issue and it got solved by adding "cron-validate": "1.4.5" to dependencies

m-a-h1 avatar Jul 22 '25 21:07 m-a-h1