S
SolidJS2mo ago
Ho-kage

SolidStart 1.0 and Deno 2.0

I think these two technologies sound very interesting together. Is there currently a happy path to trying them out?
12 Replies
calathus
calathus2mo ago
I tried to run solidjs project using deno2, but vite throws error. Deno2 site also does not mention the support of solidjs. If we can use deno2 with solidjs, it will be perfect combination for web development. I would like to know what is planned for the support of deno2
Tegan
Tegan2mo ago
Solid works on Deno, not sure if Solid Start does. https://github.com/bluwy/create-vite-extra/tree/master this repo has templates for different frameworks on deno
GitHub
GitHub - bluwy/create-vite-extra: Extra Vite templates
Extra Vite templates. Contribute to bluwy/create-vite-extra development by creating an account on GitHub.
Anshu
Anshu2mo ago
Not sure, maybe this can help https://github.com/denoland/deno/issues/20604
GitHub
Support SolidStart (SolidJS/Vite based) · Issue #20604 · denoland/d...
Platform Darwin 22.6.0 arm64 arm Version deno 1.37.0 Repro deno run -A npm:create-solid deno task dev Expected Dev server start Actual ➜ deno task dev Warning Currently only basic package.json `scr...
calathus
calathus2mo ago
the project contains solid templ;ate, but it does not use deno in package.json, while react version use deno. So solidjs seems not supported yet. I checked teh status using peplexity, I found the above bug report. Anywa, deno 2 solid js are both new, these reports are older then those new release.
Tegan
Tegan2mo ago
they don’t have package.json they use deno.json
calathus
calathus2mo ago
solid template does not have deno.json. have you test them? it may run, but it won't use deno2. I was bit confused. I was looking at ssr. . I will try that. this sample worked. but my original case still not work. I needed to put a lot of --alow**, then it ended with error for loading vite.config.mjs by tring to access stdio.on where stdio is null. I put following parameters: deno run --allow-net --allow-read --allow-env --allow-sys --allow-ffi --node-modules-dir --allow-write npm:vite my impression is better to wait until deno2 announce the support of solidjs..
Tegan
Tegan2mo ago
the --allow* flags are just how deno permissions work. if you don't care about permissions just do -A
Tegan
Tegan2mo ago
Not sure what problems you are having but it works for me
calathus
calathus2mo ago
I was able to run with the -A option after removing css, server, build, and optimizeDeps. However, I'm still encountering an error when parsing vite.config.mjs with explicit parameters: javascript TypeError: Cannot read properties of null (reading 'on') It seems this error occurs because stdio is null. It’s strange that a subset of the -A option causes an error, while -A itself works fine. In any case, if the existing configuration doesn’t work, the migration might not be straightforward. You may be able to reproduce this issue with the following vite.config.mjs:
import { defineConfig } from 'npm:[email protected]';
import deno from '@deno/vite-plugin';
import solidPlugin from 'npm:[email protected]';

export default defineConfig({
plugins: [deno(), solidPlugin()],
resolve: {
alias: {
'@': '/src',
},
},
css: {
preprocessorOptions: {
css: {
additionalData: '@import "@/styles/global.css";',
},
},
},
server: {
port: 3000,
},
build: {
target: 'esnext',
},
optimizeDeps: {
// This might help with the esbuild error
esbuildOptions: {
target: 'esnext',
},
},
});
import { defineConfig } from 'npm:[email protected]';
import deno from '@deno/vite-plugin';
import solidPlugin from 'npm:[email protected]';

export default defineConfig({
plugins: [deno(), solidPlugin()],
resolve: {
alias: {
'@': '/src',
},
},
css: {
preprocessorOptions: {
css: {
additionalData: '@import "@/styles/global.css";',
},
},
},
server: {
port: 3000,
},
build: {
target: 'esnext',
},
optimizeDeps: {
// This might help with the esbuild error
esbuildOptions: {
target: 'esnext',
},
},
});
Additionally, I often encounter a "too many files open" error. -A may work because there are more parameters to allow something?? but I did not such error message.
Ho-kage
Ho-kageOP2mo ago
@Tegan that's cool and all but can you get it to work with solid start?
Tegan
Tegan2mo ago
I didn't have to do anything special
Ho-kage
Ho-kageOP2mo ago
The unfortunate result for me on windows
No description
Want results from more Discord servers?
Add your server