ui: [bug]: Components installed to wrong directory Remix
Describe the bug
Components not being installed to location defined in component.json. Instead a components folder in the root directory is being created.
components.json
"aliases": {
"components": "~/components",
"utils": "~/lib/utils",
"ui": "~/components/ui",
"lib": "~/lib",
"hooks": "~/hooks"
}
tsconfig.json
"baseUrl": ".",
"paths": {
"~/*": ["./app/*"]
},
Affected component/components
All
How to reproduce
Followed steps described here https://ui.shadcn.com/docs/installation/remix
Codesandbox/StackBlitz link
https://stackblitz.com/edit/remix-run-remix-c99tma?file=tailwind.config.ts
Logs
No response
System Info
ProductName: macOS
ProductVersion: 14.6.1
BuildVersion: 23G9
Before submitting
- I’ve made research efforts and searched the documentation
- I’ve searched for existing issues
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 27
- Comments: 25
Facing the same issue in Laravel, it should be installed in
./resouces/js/components/uibut instead it’s installing in./components/ui/.tsconfig.json
components.json
having the same issue with remix
having same issue with laravel ,I’ve tried making a new project, but the new init still doesn’t work, I think this is related to the sidebar update? Yesterday it was still okay
The same issue for me when adding components. It should be added inside app folder instead components added in root folder
I pushed a fix for it. Can we confirm if it’s working now? (also let’s track in #5433)
Wasted an hour on this thinking it was a user error lol, AdonisJS + Intertia + React + ShadCN/UI. Actually, exactly the same setup as https://github.com/johnpgr/adonisjs-inertia-react-shadcnui which I just found. Previously it worked, new CLI now isn’t working. Was about to shoot my PC haha
Yes, I’m facing the same issue. It was working well 1 week ago, I didin’t change anything. [Remix]
Can confirm components are being installed to the correct directory (as specified in components.json and tsconfig /app/components/) in Remix
Thanks a million!
Oh, you mean after init, modify the components.json? That occurred to me, but wasn’t sure why the old behaviour wasn’t working
I think there is still an issue because
initdoesn’t accept the “@/*” path as a valid alias.But for now your suggestion should be a good enough workaround for me. Thanks @shadcn
This is working partly, but still not behaving as I would expect.
When I set my tsconfig like so:
shadcn installs “correctly” to
app/["lib"/"components"/"hooks"], but I am trying to set a custom directory for shadcn components like so:this fails with the following error:
In previous CLI you could set a custom import alias, but for some reason in v2 this doesnt work as expected. It seems like only ~/ is supported as a custom import
Urgh, this sucked up 2 hours of my life… Same issue and cant seem to find a fix
Using shadcn-ui@0.8.0 works as expected though
(in my case I have aliases for my main app:
"~/*": ["./app/*"], and"@/*": ["./app/shadcn/*"])See https://github.com/shadcn-ui/ui/issues/5433#issuecomment-2425131609 for more info about the bug