I can't get npx shadcn@latest init
to work with my already-existing next.js app
#4685
Replies: 6 comments 13 replies
-
Seems there is a bug in the latest release (0.9.0, commit, stackoverflow). You can fallback to a previous version till it's fixed. This works for me:
|
Beta Was this translation helpful? Give feedback.
-
Your latest “nextjs” project (https://github.com/fivestones/family-organizer) does not have a “next.config” file This is what the latest version of “shadcn” detects when detecting frameworks |
Beta Was this translation helpful? Give feedback.
-
it is solved? |
Beta Was this translation helpful? Give feedback.
-
No, it doesn't seem to be solved yet What I wanted to add: After following the Manual installation procedure for shadcn, in the end it mentions that you can now install components This is what I had to do at that point:
Both commands gave me errors like
but in the end it worked nevertheless. |
Beta Was this translation helpful? Give feedback.
-
Thank you |
Beta Was this translation helpful? Give feedback.
-
In 0.8 or earlier version, I could use cli to init the shadcn-ui even using webpack. But these days, it will always fail not only because of the unsupported framework, but also the internet connection... |
Beta Was this translation helpful? Give feedback.
-
I have a next.js app, and I'm trying to add shadcn. I cd into my-app, and then do
npx shadcn@latest init
. It saysI can't really find anything about this particular error online. If I do the same `npx shadcn@latest init' in an empty folder, it creaes a next.js app as expected, with shadcn all set up. But it won't work with my already existing next.js app.
I tried the manual setup, and did it all as far as I can see, but then when I tried to do
npx shadcn add Button
, I get basically the same error:My next.js app uses the new directory structure, with no src folder, and a single app folder, inside of which are page.tsx and layout.tsx.
What am I doing wrong? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions