Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork484
Open
Description
Describe the bug
When using theCalendar component with the year selector dropdown, going to the last selectable year and month and using theright arrow to go to the next month (and year) an error will be thrown and the component stops functioning. This seems to be caused by thecalendar-year-select.svelte component trying to readselectedYearItem.label in{yearItems.find((item) => item.value === value)?.label || selectedYearItem.label} whereselectedYearItem isundefined.

Reproduction
https://shadcn-svelte.com/docs/components/calendar
Go toDecember 2035 and click the right arrow to go toJanuary 2036 -> error!

Logs
Uncaught TypeError: Cannotread properties of undefined (reading'label')in<unknown>in calendar-year-select.sveltein calendar-year-select.sveltein calendar-caption.sveltein calendar-header.sveltein calendar-header.sveltein calendar-month.sveltein calendar-months.sveltein calendar.sveltein calendar.sveltein ...
System Info
System: OS: macOS 15.6 CPU: (12) arm64 Apple M2 Max Memory: 6.73 GB / 64.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 24.6.0 - /opt/homebrew/bin/node npm: 11.5.1 - /opt/homebrew/bin/npm pnpm: 10.14.0 - /opt/homebrew/bin/pnpm Browsers: Chrome: 138.0.7204.184 Safari: 18.6
Severity
annoyance