ui
ui copied to clipboard
[bug]: Electron vite init
Describe the bug
I'm trying to install shadcn on electron vite but when I use bunx --bun shadcn@latest init I get Verifying framework error
✔ Preflight checks.
✖ Verifying framework.
We could not detect a supported framework at I:\Nodejs\test-app2.
Visit https://ui.shadcn.com/docs/installation/manual to manually configure your project.
Once configured, you can use the cli to add components.
I know there are other module for electron, vite and shadcn but I want to use officials
When I use shadcn cli 0.8.0 I can install successful but not for latest version
Affected component/components
None
How to reproduce
- init electron vite project
- install tailwind
- try to init shadcn using bunx
Codesandbox/StackBlitz link
No response
Logs
✔ Preflight checks.
✖ Verifying framework.
We could not detect a supported framework at I:\Nodejs\test-app2.
Visit https://ui.shadcn.com/docs/installation/manual to manually configure your project.
Once configured, you can use the cli to add components.
System Info
Windows 10
Before submitting
- [X] I've made research efforts and searched the documentation
- [X] I've searched for existing issues
electron.vite.config.ts is part of electron vite package
@mrafieefard Duplicate your electron.vite.config.ts to vite.config.ts, shadcn needs the vite.config.ts to exist (for its preflight checks), but electron-vite requires electron.vite.config.ts to exist (no idea why, but it cant be named vite.config.ts). To prevent duplicating files you can import one into the other so you only have to write the config once.
@rafeautie can you please share your electron-vite-shadcn project structure?
@rafeautie can you please share your electron-vite-shadcn project structure?
Sure
@mrafieefard Duplicate your
electron.vite.config.tstovite.config.ts, shadcn needs thevite.config.tsto exist (for its preflight checks), but electron-vite requireselectron.vite.config.tsto exist (no idea why, but it cant be namedvite.config.ts). To prevent duplicating files you can import one into the other so you only have to write the config once.
I will check it but I think this idea works
I can confirm making a copy of your electron.vite.config.ts and calling it vite.config.ts works. Depending on your configuration you do not even need to import the vite.config.ts. Just having it in the root directory was enough to get Shadcn to install using the vite framework guide and npx init. Just make sure to copy the contents of your electron.vite.config.ts, do not just the create a file named vite.config.ts.
Hi. We're closing some old issues as outdated. If this is still relevant (and not fixed in main), leave a message, we'll reopen it. Thank you. Appreciate your contribution to the project - shadcn