Skip to content

[bug]: monorepo setup with shadcn cli doesnt work with vitest or next #8697

@alessiotortora

Description

@alessiotortora

Describe the bug

Nextjs problem:
bunx --bun shadcn@latest init -> monorepo

when running bun run dev -> cant find @tailwind/postcss , installing tailwind/postcss in apps/web fixes this problem. but normally it should take it from @workspace:ui ?

Tanstack vitest problem:
when making a monorepo setup similar to the nextjs one but with tanstack and vitest. globals.css is not updated and it saying it is updating 2 globals.css files. never gets updated.

Image

here is a fix but this stack doesnt use components.json in apps/web
tailwindlabs/tailwindcss#16733

Affected component/components

shadcn/cli

How to reproduce

  1. create monorepo setup like shadcn docs recommend
  2. make sure you have the vite setup like the shadcn docs (tsconfig.app, .node etc, resolve path)
  3. add a component with the command: bunx --bun shadcn@latest add [COMPONENT]
  4. not having a style.css in web/src/ also gives an error that there is no tailwind config (with next you dont have the problem)
  5. it detects 2 globals.css and nevers gets updated.
Image

Codesandbox/StackBlitz link

No response

Logs

System Info

tailwind v4 
tailwind/vite > 4.0.8
shadcn@latest

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions