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 init hangs while creating nextjs project #5508

Closed
2 tasks done
matt-seifert opened this issue Oct 22, 2024 · 10 comments
Closed
2 tasks done

[bug]: npx shadcn init hangs while creating nextjs project #5508

matt-seifert opened this issue Oct 22, 2024 · 10 comments
Labels
bug Something isn't working

Comments

@matt-seifert
Copy link

Describe the bug

When I run the command "npx shadcn init" or "npx shadcn@latest init", I'm prompted with the first two questions (Would you like to start a new nextjs project/What is your project's name). Once I select the name, the CLI says "Creating a new Next.js project. This may take a few minutes.". But it just sits there indefinitely and never creates anything, forcing me to eventually terminate the process. This was working fine 2 days ago, but I've been getting this bug since yesterday afternoon. Have verified this bug is operating similarly on 2 of my machines, and I had my friend verify on his machine as well.
image

Affected component/components

All

How to reproduce

Run "npx shadcn init" command and try to start a new nextjs project.

Codesandbox/StackBlitz link

No response

Logs

No response

System Info

Windows 11 Version	10.0.26100 Build 26100

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@matt-seifert matt-seifert added the bug Something isn't working label Oct 22, 2024
@Wangbaoqi
Copy link

me too

@shokks
Copy link

shokks commented Oct 22, 2024

Me too.

Is this caused by the NextJS15 released last night, where it supports React@19 RC?

clean install of create-next-app@latest gives you a fresh copy where, if you run, npx shadcn@latest init throws error with the fact that nextjs15 uses, [email protected] and @radix-ui/react-icons & @radix-ui/[email protected] use react@"^16.x || ^17.x || ^18.x"

Dependency errors, maybe?

@matt-seifert
Copy link
Author

Me too.

Is this caused by the NextJS15 released last night, where it supports React@19 RC?

clean install of create-next-app@latest gives you a fresh copy where, if you run, npx shadcn@latest init throws error with the fact that nextjs15 uses, [email protected] and @radix-ui/react-icons & @radix-ui/[email protected] use react@"^16.x || ^17.x || ^18.x"

Dependency errors, maybe?

Great sleuthing there! Sounds like a strong possibility.

@JeffinJ
Copy link

JeffinJ commented Oct 22, 2024

Same here, a new app with NextJS 15, and when installing shadcn/ui

nextjs15shadcnui-error

@codmanuel26
Copy link

I'm having the same problem it was working yesterday in the morning

@aajuu19
Copy link

aajuu19 commented Oct 22, 2024

Same problem for me. Peer dependency issue for sure because of the different react version.

If you need it asap, you can use the --legacy-peer-deps flag:
npx --legacy-peer-deps shadcn@latest init

This works for now and we should then later be able to update it to the latest version 😄

@matt-seifert
Copy link
Author

Same problem for me. Peer dependency issue for sure because of the different react version.

If you need it asap, you can use the --legacy-peer-deps flag: npx --legacy-peer-deps shadcn@latest init

This works for now and we should then later be able to update it to the latest version 😄

Thanks for the response and suggestion. Unfortunately this command still causes it to hang while creating the Next.js project. I was, however, able to do "npx [email protected]", followed by "npx shadcn init", and it seems to scaffold everything correctly. I believe Next.js version before the breaking change is 14.2, so this puts the project one version behind current. I think once things are fixed, the update to Next.js 15 should be simple. Still would rather just have the simple "npx shadcn init" worrking correctly!

@codmanuel26
Copy link

how would I do this to work with V0's block system

@shadcn
Copy link
Collaborator

shadcn commented Oct 23, 2024

Was an issue with React 19 peer deps. I temporarily pinned the deps. Should be okay now. Let me know if not.

@shadcn
Copy link
Collaborator

shadcn commented Oct 28, 2024

I'm working on a fix. Let's use #5557 to track since they are related.

@shadcn shadcn closed this as completed Oct 28, 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

7 participants