huntabyte / shadcn-svelte

shadcn/ui, but for Svelte. ✨
https://shadcn-svelte.com
MIT License
5.18k stars 318 forks source link

"no tsconfig file found for /path/to/project/package.json" error #646

Closed wickedGoal closed 9 months ago

wickedGoal commented 9 months ago

Describe the bug

Installing on sveltekit project with no type checking with Typescript fails with above error. It seems JSDoc type checking Issue #610 is resolved but not with no type checking.

Reproduction

none

Logs

✔ Running this command will install dependencies and overwrite your existing tailwind.config.[cjs|js|ts] & app.pcss file. Proceed? … yes                                                                    ✔ Which style would you like to use? › Default                                                        ✔ Which color would you like to use as base color? › Slate                                            ✔ Where is your global CSS file? … src/app.pcss                                                       ✔ Where is your tailwind.config.[cjs|js|ts] located? … tailwind.config.cjs                            ✔ Configure the import alias for components: … $lib/components                                        ✔ Configure the import alias for utils: … $lib/utils                                                  ✔ Write configuration to components.json. Proceed? … yes                                              Your tailwind.config.cjs has been renamed to tailwind.config.js.                                                                                                                                            

ERROR: no tsconfig file found for /path/to/project/package.json

System Info

System:                                                                                             
    OS: macOS 14.2.1                                                                                  
    CPU: (8) arm64 Apple M1                                                                           
    Memory: 630.63 MB / 16.00 GB                                                                      
    Shell: 5.9 - /bin/zsh                                                                             
  Binaries:                                                                                           
    Node: 21.5.0 - /opt/homebrew/bin/node                                                             
    npm: 10.2.4 - /opt/homebrew/bin/npm                                                               
  Browsers:                                                                                                                                                           
    Chrome: 120.0.6099.216                                                                            
    Safari: 17.2.1                                                                                    
  npmPackages:                                                                                        
    @sveltejs/kit: ^2.0.0 => 2.3.2                                                                    
    svelte: ^4.2.7 => 4.2.8

Severity

annoyance

AdrianGonz97 commented 9 months ago

Type checking with typescript or jsdoc is required. The CLI prefaces this with the following:

This command assumes a SvelteKit project with TypeScript and Tailwind CSS.
If you don't have these, follow the manual steps at https://shadcn-svelte.com/docs/installation

I would suggest using the JSDoc template from npm create svelte@latest if you'd like to use plain JS with our components.

We're looking into adding support for normal JS in the future, but we currently have no concrete plans yet.