Closed vajkayrene closed 1 year ago
You're absolutely right! Typescript cached a version of @types/luxon
on my machines, so I didn't notice that error, thank you for reporting the issue!
You're absolutely right! Typescript cached a version of
@types/luxon
on my machines, so I didn't notice that error, thank you for reporting the issue!
Yes, I had the same issue. 😄 Typescript cached the library on my local machine and I was scratching my head for 30 minutes about why it fails on the CI/CD server.
If we'd add @types/luxon
to this project, it would need to be added to the regular dependencies
, so it would be installed for all users (even JS ones). The issue is that the package size is 115 kB
while cron
is only 59.2 kB
.
Would you find installing the @types/cron
package in your development dependencies a good solution until we convert the library to TS? If so I'll update the README to include a section about this.
On the other hand luxon
is 4.06 MB
so I guess adding 115 kB
is not the end of the world
If we'd add
@types/luxon
to this project, it would need to be added to the regulardependencies
, so it would be installed for all users (even JS ones). The issue is that the package size is115 kB
whilecron
is only59.2 kB
. Would you find installing the@types/cron
package in your development dependencies a good solution until we convert the library to TS? If so I'll update the README to include a section about this.
I tried to install @types/cron
, but the fact is typescript still gives me the original issue. I was able to fix it by installing @types/luxon to my devDependecies.
I'm sorry I made a mistake in my message, I meant @types/luxon
indeed :sweat_smile:
@types/cron
is deprecated since we imported their types and now ship them directly within cron
.
I've made a PR to add @types/luxon
to our dependencies, it should be merged soon :) thanks for the heads up!
No problem, thanks for the quick fix!
:tada: This issue has been resolved in version 2.4.2 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
I've made a PR to add
@types/luxon
to our dependencies, it should be merged soon :) thanks for the heads up! Hi, after update and clean build I started receiving node_modules/@types/luxon/src/settings.d.ts:27:16 - error TS2380: 'get' and 'set' accessor must have the same type.
27 static get defaultZone(): Zone;
node_modules/@types/luxon/src/settings.d.ts:28:16 - error TS2380: 'get' and 'set' accessor must have the same type.
28 static set defaultZone(zone: Zone | string);
![image](https://github.com/kelektiv/node-cron/assets/24919819/f422c176-4968-4640-a3a7-3b83889d2fe5)
To fix it, I needed to downgrade back to 2.4.0 version. My current TS version is 4.2.3
@SirAndrii thanks for reporting on this, let's track this here: https://github.com/kelektiv/node-cron/issues/692
:tada: This issue has been resolved in version 3.0.0-beta.4 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Description
The following error message is thrown from the cron module (using Typescript):
The issue is caused by a missing type definition for the luxon library. The docs for the library states it should be installed as a developer dependency separately for typescript.
Screenshots
Additional information
No response