Issue with shadcn-ui component installation path in WXT project #1192
Unanswered
only-issues
asked this question in
Q&A
Replies: 1 comment
-
You could define your own paths in the root TS config, and not inherit any from the one inside the .wxt directory. If the aliases change you would have to update your own list, which is a little annoying. But maybe that will work? Of course, you should also open an issue in shadcn, seems like they're not parsing TS config files correctly. Maybe also search nuxt for for a similar issue. They use the same structure of the ../prefix in the .nuxt directory. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm encountering an issue with shadcn-ui component installation in my WXT project. The components are being installed outside of my project directory, despite having the correct path configuration in
components.json
.Current Setup
My
components.json
configuration:The Problem
When I run the command
pnpm dlx shadcn@latest add button
, the component gets installed outside my project directory:Current structure after installation:
Root Cause Analysis
I believe this is happening because WXT creates its own
tsconfig.json
in.wxt/tsconfig.json
with a path configuration where"@/"
is set to"../src/*"
. It seems that shadcn-ui's installation process doesn't properly handle this nested tsconfig situation, leading to incorrect path resolution.Attempted Solutions
I've tried adding aliases in
wxt.config.ts
:However, both attempts result in WXT adding
..
prefix in.wxt/tsconfig.json
, which doesn't solve the issue.And finally, I want to know if there is any other way to fix it?
Beta Was this translation helpful? Give feedback.
All reactions