ui
ui copied to clipboard
Error when running install with CLI in Nx
When trying to add a new component to an nx project the error Failed to load tsconfig.json. Couldn't find tsconfig.json occurs. Normally for nx projects you will have a tsconfig.base.json and have tsconfig.json files per project. As of now, I just have an empty tsconfig at the root but wondering if could be fixed.
Thanks
I have the same issue.
I had this same issue but here is how I resolved it. First I added a few project command like so in my apps/app directory (which is a nextjs project).
...
"ui:add": {
"executor": "./tools/executors/workspace:run-command",
"options": {
"command": "pnpx shadcn-ui add",
"cwd": "./"
},
},
"ui:init": {
"executor": "./tools/executors/workspace:run-command",
"options": {
"command": "pnpx shadcn-ui init",
"cwd": "./"
}
}
...
The custom executor for doing interactive commands in nx I saw from this issue: https://github.com/nrwl/nx/issues/8269
In this directory is a tsconfig.json which should be read by shadcn-ui
I created a GitHub repository with shadcn UI configuration from Nx, you can check it on my profile. And I made a YouTube tutorial on how to do it (It's my first video so it's not that good but I decided to give it a try 😅).
YouTube: Setup tutorial GitHub repo: Repository Boilerplate
@anteqkois In your setup, you have one app and components.json points to that app. How would you configure this with multiple apps?
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.