-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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]: Installation fails with Next.js 15 and/or React 19 #5557
Comments
Yeah, it is also coming for me do you got any solution ? |
I need this urgently, is there any other solution for this ? |
Do you need a temporary solution for this ? |
you can use overrides for a temporary fix. "overrides": {
"react": "$react",
"react-dom": "$react-dom"
} Warning This is just a temporary fix! |
You can also use: |
No, it did not work for me I tried it. I just cloned old next js project I created in previous week and started using it for development, will change to nextjs 15 after the pr is merged. |
Hey @TaifurIslamAshraf, I tested out this scenario and was able to get shadcn-ui running smoothly with the New York theme and the Here's what I did:
Everything worked both locally and in production without issues. Prod links: For reference, here are some key details about my setup:
Feel free to check out the repo directly here: GitHub Repo to make sure everything is set up correctly. Let me know if you need more details or if there's anything else I can help test! |
i got this like error but u can fix in
|
Solution is to install |
I keep getting this error what should I do? |
I found a solution. Use pnpm package manager |
Just using pnpm solves it? |
Yes |
I guess that's why my setup had no issues then, using pnpm |
Nahh man it must be due to the new release ig |
check the blog solve this problem |
Can someone confirm if this it works with
|
are you using npm? and you used one of the |
I am using npm and have been using |
@shadcn - looks like pacocoursey/cmdk#318 was merged and release was issued when are we going to have this in shadcn release? |
you will need to make sure your vercel "Build & Development Settings" links to prod example: |
is there a way to skip the interactive prompt that asks for |
Thanks, it works. |
@Jacksonmills thanks for the detailed write-up. I’m surprised this is still an issue. Tested this a few times yesterday. I’ll take a look. |
Let me know if I can help test anything specific if needed |
I'm also having this issue when creating from a new Next JS project. Confirmed that this happens with v2.1.4 via v2.1.3 works fine and allows me to select --force or --legacy-peer-deps |
I'm bringing back the flags (temporarily). |
The issue I noticed is not related to shadcn-ui but other dependencies and is prevents schadcn-ui adding components or init
In my case |
@rishi-novo @souvik-basak I can't reproduce. can you access https://ui.shadcn.com/r/styles/default/utils.json? |
Why |
I am also facing the installation error
Any help? |
@jasonjos111 this command doesn't seem to work on workspaces: this is what i get if i run this command inside my NextJs project inside a monorepo well if i run this command: i don't get any output- meaning it works. |
So it is definitely an issue with next.js Version 15. I have taken the trouble to go back to the oldest Next version 14, to 14.2.14 to be precise. In my current repo I have described at the bottom under DEBUGGING and ERROR LOG how I went back to V14 and was able to continue working.: https://github.com/Svendolin/Bachelor-Project-SKA2025 I hope we can jump back to V15 at some point🤒 |
Describe the bug
While initializing a new Next.js project with shadcn-ui using
npx shadcn@latest init
, the installation fails when attempting to install dependencies. The error occurs because @radix-ui/react-icons has a peer dependency requirement for "react@^16.x || ^17.x || ^18.x", but the project is using React 19.0.0-rc-69d4b800-20241021.Error message:
npm error ERESOLVE unable to resolve dependency tree
npm error Found: [email protected]
npm error Could not resolve dependency:
npm error peer react@"^16.x || ^17.x || ^18.x" from @radix-ui/[email protected]
Current environment:
The installation works fine with React 18, suggesting that @radix-ui/react-icons needs to be updated to support React 19 release candidates.
Potential solutions:
Affected component/components
shadcn-ui installation fails
How to reproduce
During the setup, select 'yes' for App Router and other default options
Navigate to the project directory:
bash
cd my-app
Try to initialize shadcn-ui:
bash
npx shadcn@latest init
Select configuration options:
The installation will fail during the dependency installation step with the following error:
npm error ERESOLVE unable to resolve dependency tree
npm error Found: [email protected]
npm error Could not resolve dependency:
npm error peer react@"^16.x || ^17.x || ^18.x" from @radix-ui/[email protected]
You can verify the React version in your package.json:
{
"dependencies": {
"react": "19.0.0-rc-69d4b800-20241021",
"react-dom": "19.0.0-rc-69d4b800-20241021"
}
}
Codesandbox/StackBlitz link
No response
Logs
No response
System Info
System Information: Operating System: - Windows 8 - Working in Command Prompt Node Environment: - Node.js version: v20.17.0 - npm version: v10.9.0 Project Dependencies: - Next.js: 15 - React: 19.0.0-rc-69d4b800-20241021 - React DOM: 19.0.0-rc-69d4b800-20241021 - Typescript: ^5 - Tailwind CSS: ^3.4.1 CLI Versions: - create-next-app: latest - shadcn-ui CLI: latest (@shadcn/ui) Additional Context: - Fresh installation with default configurations - Using App Router - Project created with TypeScript and Tailwind CSS enabled
Before submitting
The text was updated successfully, but these errors were encountered: