Skip to content
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

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

Closed
arkmoon opened this issue Dec 8, 2023 · 5 comments
Closed
Labels

Comments

@arkmoon
Copy link

arkmoon commented Dec 8, 2023

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": "./", 
@arkmoon arkmoon changed the title Missing configuration when not using solid-start Missing configuration when trying to use SSR and not using solid-start Dec 8, 2023
@arkmoon arkmoon closed this as not planned Won't fix, can't repro, duplicate, stale Dec 8, 2023
@sek-consulting
Copy link
Owner

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.

@sek-consulting sek-consulting reopened this Dec 9, 2023
@arkmoon
Copy link
Author

arkmoon commented Dec 9, 2023

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
Copy link
Owner

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
Copy link
Owner

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

@nickovs
Copy link

nickovs commented Aug 13, 2024

I am running into the same issue, despite having added the suggested changes to vite.config.ts and tsconfig.json. These fixes seem to work for npm run dev but not for npm run buid. The problem is probably down to this issue with Vite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants