reactjstypescripttailwind-cssvite

Can Shadcn ui be installed for Vite + React with javascript and not typescript?


I am having trouble installing and using shadcn components on mt vite + react + tailwind project. i tried following the guide in their documentation here. It seems that it requires typescript for it to work?

I tried to:

  1. Create a React Javascript project with Vite
  2. Install Tailwind for Vite React from their doc.
  3. Follow the shadcn guide in their docs i linked above.

It says it needs the "tsconfig.json" file, which means typescript. I then tried the steps above again, but instead of javascript i created a Typescript project. But it still did not work, i get this error when i try to run the server with npm run dev : EISDIR: illegal operation on a directory, read

I have uploaded the source code on github here


Solution

  • import { Button } from "@/components/ui/button" Should work