bree
bree copied to clipboard
TypeError: cron is not a function
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.
in my case,
i'm using "cron-validate": "1.4.5", for temporary
i hope fixed version will be released soon. 🙏
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.
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;
i had the same issue and it got solved by adding "cron-validate": "1.4.5" to dependencies