Skip to content

[bug]: calendar.tsx incompatible with react-day-picker v10 (persian subpath removed) #11012

Description

@matintohidi

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

  1. Add the calendar component via shadcn CLI
  2. Use the Persian calendar variant (as shown in docs)
  3. Install react-day-picker@10 (latest)
  4. Run dev server
  5. 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

  • I've made research efforts and searched the documentation
  • I've searched for existing issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions