After upgrading Day.js from 1.11.10 to 1.11.19, our project started failing to compile due to a TypeScript type error involving the year() method. This issue did not occur in previous versions and appears to be a regression or unintended breaking change introduced in a patch release.
Error message:
The types returned by 'value.year(...)' are incompatible between these types.
Type 'number' is not assignable to type 'Dayjs'.
Versions
React + Vite project
Working dayJS version: 1.11.10
Failing dayJS version: 1.11.19
Typescript version: 5.5.4
React version: 18.2.0