Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: npx shadcn@latest add sidebar-05 fails with (NextJs 15 or react 19) #5690

Closed
2 tasks done
Sujood-Qureshi opened this issue Nov 3, 2024 · 4 comments
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@Sujood-Qureshi
Copy link

Describe the bug

when installing sidebar-5 components using npx shadcn@latest add sidebar-05 getting the error related to --legacy-peer-deps.
When using cli command it should ask to use --force or --legacy-peer-deps but its not asking for it.

Affected component/components

sidebar-5 (block)

How to reproduce

  1. Copy the command npx shadcn@latest add sidebar-05.
  2. Navigate to your project's root directory in you terminal.
  3. Paste and run the command.
  4. You will get the error

Codesandbox/StackBlitz link

No response

Logs

✔ Checking registry.
✔ Updating tailwind.config.ts
✔ Updating src\app\globals.css
⠏ Installing dependencies.
Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.

Command failed with exit code 1: npm install @radix-ui/react-slot class-variance-authority lucide-react @radix-ui/react-separator @radix-ui/react-dialog @radix-ui/react-tooltip @radix-ui/react-label @radix-ui/react-collapsible
npm warn ERESOLVE overriding peer dependency
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: @radix-ui/[email protected]
npm error Found: [email protected]
npm error node_modules/react
npm error   peer react@"^16.8.0 || ^17.0.0 || ^18.0.0" from [email protected]
npm error   node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll
npm error     react-remove-scroll@"2.6.0" from @radix-ui/[email protected]
npm error     node_modules/@radix-ui/react-dialog
npm error       @radix-ui/react-dialog@"*" from the root project
npm error
npm error Could not resolve dependency:
npm error peer react@"^16.x || ^17.x || ^18.x || ^19.x" from @radix-ui/[email protected]
npm error node_modules/@radix-ui/react-icons
npm error   @radix-ui/react-icons@"^1.3.1" from the root project
npm error
npm error Conflicting peer dependency: [email protected]
npm error node_modules/react
npm error   peer react@"^16.x || ^17.x || ^18.x || ^19.x" from @radix-ui/[email protected]
npm error   node_modules/@radix-ui/react-icons
npm error     @radix-ui/react-icons@"^1.3.1" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:

System Info

I am using node version v20.17.0

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@Sujood-Qureshi Sujood-Qureshi added the bug Something isn't working label Nov 3, 2024
@justinherrera
Copy link

Can you verify to install other ui? I believe it will also fail. Im facing the same issue, yesterday I successfully migrated from 14 to next 15 and just today everything fails

@duc-dev
Copy link

duc-dev commented Nov 4, 2024

Use [email protected] instead: npx [email protected] add sidebar-05

@Sujood-Qureshi
Copy link
Author

Can you verify to install other ui? I believe it will also fail. Im facing the same issue, yesterday I successfully migrated from 14 to next 15 and just today everything fails

Yes it failed for other ui components too. but for now to resolve this error i just downgraded my react and react-dom version from 19 to 18.
Although react18 is working good with NextJs 15.

@shadcn
Copy link
Collaborator

shadcn commented Nov 4, 2024

I'm going to temporarily bring back the npm flags. Let's track in #5557 please.

@shadcn shadcn closed this as completed Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants