@slate steppe thanks for this!!
I added the components.json file as well as the tsconfig.json file. After this, I did npx shadcn add to add a slider component as an example. It did ensure that the component was added to the respective app/frontend/components/ folder.
I then created a controller using rails g inertia:controller [ControllerName] actions and then inserted the slider component into the .tsx file.
When I tried running the demo app, I got this error:
21:06:51 web.1 | ActionController::RoutingError (No route matches [GET] "/stylesheets/application.css"):
21:06:51 web.1 |
21:06:52 vite.1 | 9:06:52 PM [vite] Internal server error: Failed to resolve import "@/lib/utils" from "app/frontend/components/ui/slider.tsx". Does the file exist?
21:06:52 vite.1 | Plugin: vite:import-analysis
21:06:52 vite.1 | File: /Users/shreyas/Desktop/Projects/inertiarocks/app/frontend/components/ui/slider.tsx:4:19
21:06:52 vite.1 | 17 | import * as React from "react";
21:06:52 vite.1 | 18 | import * as SliderPrimitive from "@radix-ui/react-slider";
21:06:52 vite.1 | 19 | import { cn } from "@/lib/utils";
21:06:52 vite.1 | | ^
21:06:52 vite.1 | 20 | const Slider = React.forwardRef(
21:06:52 vite.1 | 21 | _c = ({ className, ...props }, ref) => /* @__PURE__ */ jsxDEV(
It seems that @/lib/utils is missing a file. I'm not sure what file needs to be added, and I'm also unsure why there is a GET error for "/stylesheets/application.css" since the stylesheets are under /frontend/entrypoints/application.css
This the git repo: https://github.com/shreyas-makes/inertiarocks