-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
|
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🤒 |
Error with Radix UI Menu: Module Not Found for @radix-ui/react-dismissable-layer I’m encountering the following error when running pnpm run dev ⨯ ./node_modules/.pnpm/https://github.com/radix-ui+react-menu@[2.1.2_@types](mailto:2.1.2_@types)+react-dom@[18.3.1_@types](mailto:18.3.1_@types)+react@[[email protected]_o4jcdnyvzxbdzi7cnpkmx2wl2q](mailto:[email protected]_o4jcdnyvzxbdzi7cnpkmx2wl2q)/node_modules/@radix-ui/react-menu/dist/index.mjs:10:1 10 | import { DismissableLayer } from "@radix-ui/react-dismissable-layer"; https://nextjs.org/docs/messages/module-not-found The error occurs during pnpm run dev, but pnpm run build works fine. Steps Taken Environment pnpm run build: Works Any suggestions or fixes would be greatly appreciated |
run the command : |
This fixed the error for me
I found the solution on here: https://github.com/vercel/next.js/issues/72204.
|
Getting the same issues as @jasonjos111,
Setup:
Errors:What is see in my UI components: Type 'ForwardRefExoticComponent<AccordionItemProps & RefAttributes<HTMLDivElement>>' does not satisfy the constraint 'keyof IntrinsicElements | ForwardRefExoticComponent<any> | (new (props: any) => Component<any, {}, any>) | ((props: any) => ReactNode)'.
Type 'ForwardRefExoticComponent<AccordionItemProps & RefAttributes<HTMLDivElement>>' is not assignable to type 'ForwardRefExoticComponent<any>'.
Type 'React.ReactNode' is not assignable to type 'import("/Users/jacob/Documents/GitHub/BuzzTrip/apps/web/node_modules/@types/react/index").ReactNode'.
Type 'bigint' is not assignable to type 'ReactNode'. what is see when consuming my components: 'Button' cannot be used as a JSX component.
Its type 'ForwardRefExoticComponent<ButtonProps & RefAttributes<HTMLButtonElement>>' is not a valid JSX element type.
Type 'ForwardRefExoticComponent<ButtonProps & RefAttributes<HTMLButtonElement>>' is not assignable to type '(props: any, deprecatedLegacyContext?: any) => ReactNode'.
Type 'import("/Users/jacob/Documents/GitHub/BuzzTrip/apps/web/node_modules/@types/react/index").ReactNode' is not assignable to type 'React.ReactNode'.
Type 'ReactElement<unknown, string | JSXElementConstructor<any>>' is not assignable to type 'ReactNode'.
Property 'children' is missing in type 'ReactElement<unknown, string | JSXElementConstructor<any>>' but required in type 'ReactPortal'. Not sure how to fix this issue, i have tried setting The repo: https://github.com/jacobsamo/BuzzTrip/tree/improve-web |
Try this: In https://github.com/jacobsamo/BuzzTrip/blob/improve-web/package.json add the following: "overrides": {
"@types/react": "npm:[email protected]",
"@types/react-dom": "npm:[email protected]"
} Then delete all the node_modules and re-run |
Anyone know how to fix the error 'button cannot be used as a JSX component' in a turborepo? I have to add pnpm overrides in the root workspace but that is also giving me an error |
This works very well |
For NextJS15 and React19, if you use "overrides": {
"react-is": "$react-is",
"@types/react": "npm:[email protected]",
"@types/react-dom": "$@types/react-dom-rc.1"
},
"resolutions": {
"@types/react": "npm:[email protected]",
"@types/react-dom": "npm:[email protected]"
} |
I also see this issue. |
Could be a temporary solution, this works for me:
|
Nextjs got updated with react stable , why are still getting the |
Any update regarding nextjs15 and other one more library that creates problem for installation:- Radix? |
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: