Describe the bug
The Persian calendar variant in calendar.tsx imports from react-day-picker/persian,
which was removed in react-day-picker v10. This causes a build error when using the
latest version of the package.
In v10, the Persian calendar was extracted to a separate package. The fix is to either:
- Downgrade to react-day-picker@9
- Or install
@daypicker/persian and update the import:
// Before
import { DayPicker } from "react-day-picker/persian"
// After
import { DayPicker } from "@daypicker/persian"
Additionally, the documentation at https://ui.shadcn.com/docs/components/base/calendar#date-picker
should be updated to mention that react-day-picker v10 requires @daypicker/persian
instead of the built-in persian subpath.
Related migration guide: https://zenn.dev/ui_memo/articles/5452fb2eef71a8?locale=en
Affected component/components
Calendar
How to reproduce
- Add the calendar component via shadcn CLI
- Use the Persian calendar variant (as shown in docs)
- Install react-day-picker@10 (latest)
- Run dev server
- Build error: Failed to resolve import "react-day-picker/persian"
Codesandbox/StackBlitz link
No response
Logs
[plugin:vite:import-analysis] Failed to resolve import "react-day-picker/persian"
from "src/components/ui/calendar.tsx". Does the file exist?
System Info
react-day-picker: 10.0.1
shadcn: 4.10.0
Before submitting
Describe the bug
The Persian calendar variant in calendar.tsx imports from
react-day-picker/persian,which was removed in react-day-picker v10. This causes a build error when using the
latest version of the package.
In v10, the Persian calendar was extracted to a separate package. The fix is to either:
@daypicker/persianand update the import:// Before
import { DayPicker } from "react-day-picker/persian"
// After
import { DayPicker } from "@daypicker/persian"
Additionally, the documentation at https://ui.shadcn.com/docs/components/base/calendar#date-picker
should be updated to mention that react-day-picker v10 requires @daypicker/persian
instead of the built-in persian subpath.
Related migration guide: https://zenn.dev/ui_memo/articles/5452fb2eef71a8?locale=en
Affected component/components
Calendar
How to reproduce
Codesandbox/StackBlitz link
No response
Logs
System Info
Before submitting