ui icon indicating copy to clipboard operation
ui copied to clipboard

Adding Shadcn to turborepo monorepo causing import errors

Open sambhav6496 opened this issue 1 year ago • 1 comments

Hi, I am adding shadcn to turborepo monorepo and while initialising shadcn it adds components folder in @ folder.

the folder structure of ui folder. Screenshot 2024-01-08 at 7 42 13 AM

tsconfing.json Screenshot 2024-01-08 at 7 42 28 AM

components.json Screenshot 2024-01-08 at 7 42 37 AM

issue while importing Screenshot 2024-01-08 at 7 46 15 AM

sambhav6496 avatar Jan 08 '24 02:01 sambhav6496

Hi @shadcn, I have similar issue with turborepo vite setup.

There is a repo turborepo-shadcn-ui where this setup works perfectly with nextjs. I tried to do the same with Vite but it seems I am missing something and see exactly this error as an OP.

Maybe the cause is different, but could you please give us some insight into how we can fix it?

My PR where I add Vite

evgenius1424 avatar Feb 12 '24 22:02 evgenius1424

This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.

shadcn avatar Jun 03 '24 23:06 shadcn

Hi @shadcn, this seems to still very much be an issue. I've tried creating a new package within the monorepo and redoing the init step to rule out that it was done incorrectly the first time, but it's still producing the same result. Following the pnpm dlx shadcn-ui@latest init step, I am running pnpm dlx shadcn-ui@latest add to select multiple components at a time. Instead of being placed into the packages/shadcn folder, they are being placed at the root of the project in a directory named @.

Do you have any insight on the proper way to configure shadcn within a turborepo?

metal-face avatar Jun 09 '24 03:06 metal-face

Just confirming this is still an issue, just tried to init shadcn in a turborepo (nextjs) project and stumbled upon the same import errors. I think it needs to be re-opened @shadcn?

koslib avatar Jul 21 '24 19:07 koslib

same here

ahmed-adly-khalil avatar Jul 21 '24 22:07 ahmed-adly-khalil

same

sidpg123 avatar Aug 01 '24 14:08 sidpg123