-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: In a javascript nuxt project the components are created outside of the project root folder #291
Comments
https://stackblitz.com/edit/github-3ryei7 Add this to your export default defineNuxtConfig({
typescript: {
tsConfig: {
compilerOptions: {
baseUrl: '.'
}
}
}
}) That's strange 😕 With But with |
Oh, yeah that works but when I put it in |
@Dunqing Can you also check this? It's I explained it above |
I will take a look soon. |
I had the following problem during the init phase :
I able to solve this problem by having the following jsconfig.json file in my project root before calling
In the initial instructions I skipped this step, because I have a js project. : I believe that skipping this step causes the project to not have a config file. I would add in a solution for js projects to the documentation. However even though the init shows successful, as pointed out here the I followed @sadeghbarati suggestion of adding this to nuxt.config.ts but it didnt work. |
Anyone working on this? |
I'm encountering the same issues as @AdamBD and @hubcio2115 |
This fixed iit for me npx shadcn-vue@0.10.4 add tabs |
I have Nuxt/TS project and this change in |
how does this help with the |
this bug is related to JS installations, not TS |
Because the bug was introduced with shadcn-vue@0.10.5 so using shadcn-vue@0.10.4 works. |
Definitely also exists in TS with shadcn-vue@0.10.5 |
yep this fixed it for me whe using nuxt, I guess during the init steps you need to point inside of the .nuxt folder instead of the root tsconfig |
Then |
I found that the component has just loaded to /.nuxt/components/ui/ so you've just copied and pasted it in the right path. |
@zernonia Please fix this |
Still persists. However this in fact fixed it for me, so thank you @gormal :
|
Hey I've used this fix but this adds a folder named "*" everytime |
I think the root cause of this issue is dividab/tsconfig-paths#265. The {
// https://v3.nuxtjs.org/concepts/typescript
"extends": "./.nuxt/tsconfig.json"
} The The TypeScript docs says about the
(emphasis is mine). Thus, for each relative For example if the root file is
then In this case resolving this path to the path of the root E.g. for a project like this:
calling
This relative path after resolving to But currently
That means that the final path will be WorkaroundsEither add Both are not truly "correct" solutions as:
|
Replacing Nuxt: https://stackblitz.com/edit/github-j46xhz |
This should be fixed now with latest cli 😁 |
Environment
Link to minimal reproduction
https://github.com/hubcio2115/shadcn-nuxt-minimal-reproduction
Steps to reproduce
Run
Describe the bug
In a fresh javascript nuxt project with default configuration folders for
lib
andcomponents
get created outside of the project folder. Any subsequent runs ofshadcn-vue add
also put components outside of the project folder.Everything works fine in a typescript project.
Expected behavior
components
andlib
are added to the project and components added through cli add are also put where they suppose to be as per the shadcn configuration.Conext & Screenshots (if applicable)
The text was updated successfully, but these errors were encountered: