sek-consulting / solid-ui

Beautifully designed components. Built with Kobalte & corvu. Styled with Tailwind CSS.
https://www.solid-ui.com
MIT License
680 stars 25 forks source link

Missing configuration when trying to use SSR and not using solid-start #45

Closed arkmoon closed 3 months ago

arkmoon commented 7 months ago

Just a heads up if anyone is trying to add this to just a Vite TS app without using Solid-Start and getting this error when trying to use Vite SSR.

Error: Cannot find module '~/lib/utils' imported from '[project path]/src/components/ui/button.tsx'

Had to manually add some changes, here:

/* vite.config.ts */
+ import { resolve } from 'node:path';

export default defineConfig({
  plugins: [solid({ ssr: true })],
  + resolve: {
  +  alias: [{ find: '~', replacement: resolve(__dirname, './src') }],
  + },
});
/* tsconfig.json */
  "paths": {
      "~/*": [
        "./src/*"
      ]
    },
  +  "baseUrl": "./", 
sek-consulting commented 7 months ago

Thanks for the Feedback.

Even though you already closed the issue I'll have a look at it since the fix could be similar to the one for astro.

arkmoon commented 7 months ago

Thanks for the quick reply. I'm still tinkering with it. I might end up using Solid Start anyway just because the TypeScript the way I have it set up is giving me linting errors. So I'm trying to figure out what I'm missing.

Unrelated thing but a quick request: when using the CLI to download components, they default to line endings CRLF (/r/n Windows line endings). Would be nice to have the option to chose Unix line endings instead: LF (/n). I'm on a Mac, so I have to go through every file each time in VSCode and manually change it. It's not a big deal since this is just a personal preference, but would be nice if it were an option.

You're doing great work, thank you!

sek-consulting commented 6 months ago

Thanks for the input. I switched from windows to unix linefeeds since windows can handle both anyway.

I bumped the version to v0.3 but since the changes are in the online registry it's already active even without an update to the cli.

sek-consulting commented 3 months ago

this should be covered by the new installation guides in the docs: https://www.solid-ui.com/docs/installation/overview