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]: unable to initialize for next Js 15+ #5702

Closed
2 tasks done
aadltya opened this issue Nov 4, 2024 · 5 comments
Closed
2 tasks done

[bug]: unable to initialize for next Js 15+ #5702

aadltya opened this issue Nov 4, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@aadltya
Copy link

aadltya commented Nov 4, 2024

Describe the bug

The issue seems to stem from the dependency tree being unable to resolve the peer dependency for @radix-ui/react-icons with React 19. Suggestions to resolve it using --legacy-peer-deps or --force were not ideal, as they may lead to other conflicts.

Affected component/components

unable to add any components

How to reproduce

bug

Codesandbox/StackBlitz link

No response

Logs

$ npx shadcn@latest init
✔ Preflight checks.
✔ Verifying framework. Found Next.js.
✔ Validating Tailwind CSS.
✔ Validating import alias.
√ Which style would you like to use? » New York
√ Which color would you like to use as the base color? » Zinc
√ Would you like to use CSS variables for theming? ... no / yes
✔ Writing components.json.
✔ Checking registry.
✔ Updating tailwind.config.js
✔ Updating app\index.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 tailwindcss-animate class-variance-authority lucide-react @radix-ui/react-icons clsx tailwind-merge
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"19.0.0-rc-02c0e824-20241028" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.x || ^17.x || ^18.x || ^19.x" from @radix-ui/[email protected]
npm ERR! node_modules/@radix-ui/react-icons
npm ERR!   @radix-ui/react-icons@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! C:\Users\ADITYA\AppData\Local\npm-cache\_logs\2024-11-04T06_55_31_607Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: C:\Users\ADITYA\AppData\Local\npm-cache\_logs\2024-11-04T06_55_31_607Z-debug-0.log

System Info

windows 10

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@aadltya aadltya added the bug Something isn't working label Nov 4, 2024
@mallickwebstudio
Copy link

mallickwebstudio commented Nov 4, 2024

I'm facing the same issue. It slows the development process and not Ideal condition.

@aadltya
Copy link
Author

aadltya commented Nov 4, 2024

I'm facing the same issue. It slows the development process and not Ideal condition.

you can fix this using the previous version of shadcn

following that ex:

npx [email protected] add button

@FurkanGulabi
Copy link

you can fix using

npm config set legacy-peer-deps true

and

npx shadcn@latest init

then

npx shadcn@latest add button

it will be fine.

you can revert npm settings using

npm config set legacy-peer-deps false

hope it works.

@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
@aadltya
Copy link
Author

aadltya commented Nov 4, 2024

yes that will help

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