SolidJS

S

SolidJS

Solid is a declarative reactive Javascript library for creating user interfaces.

Join

Throw vs return in routerโ€™s action

Suppose I have an action that should redirect. In the docs(https://docs.solidjs.com/solid-router/reference/data-apis/action) I found example of both returning and throwing a redirect. Which should be used and when?...

SSR failed to import "drizzle-orm/bun-sqlite"

Hi, here's the error I get ``` 1:20:01 PM [vite] Error when evaluating SSR module /src/db/index.ts: failed to import "drizzle-orm/bun-sqlite" |- Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. Received protocol 'bun:' at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:228:11)...

Weird Vinxi dev issue

Anytime I call/use this function, it seems to completely break vinxi's build in dev and throws a crazy weird error.

Solid devtools with Astro

I try to use solid devtools extension with Astro but is shows Solid Not Detected. Webpage work fine with solidjs. I edit astro.config.mjs file in Astro ``JavaScript...

CI only error: no such file or directory server-functions-manifest.json

I am getting a no such file or directory error while vinxi build is running for the server-functions-manifest.json. It only happens in ci, in both vercel and cloudflare pages. With start 1.0.10 & vinxi 0.4.3. Just in case somebody saw this one before, has a clue what I could be doing wrong. I saw some messages previously with this error, but only when the build output folder is changed. Which I did not, however by start app is inside a mono repo. Full project is available here. Its a bit messy atm: https://github.com/hkviz/hkviz-web/tree/move-to-solid-start/packages/app2 logged error of vinxi build in thread...

Nested layouts with dynamic route

I am using solid start with file based routing. I want to create routes with nested layout. I want to have routes /plans/[id] and /plans/[id]/select. Both of these routes should share same layout, how can I acheive it with dynamic paremeter?

`useNavigate` inside an `action`?

I am trying to use useNavigate in an action when my form is submitted. However my page isn't navigating. No errors appear in console. ``` const some_action = action(async (data) => {useNavigate()("/")}) ...

All of a sudden `classList` is typed as string | undefined

I am using SolidJS with Astro and at one point I duplicated a component file to extract logic into it and now class and classList have unexpected types: ```src/Wes95/components/Window.tsx:159:14 - error ts(2322): Type '{ children: Element[]; class: string; }' is not assignable to type 'HTMLAttributes<HTMLDivElement>'. Property 'class' does not exist on type 'HTMLAttributes<HTMLDivElement>'. ...

Handling 404 within existing catch-all route

Wondering what the pattern/best approach is for displaying a 404 page/component within a catch-all route. Using solid start/<FileRoutes>, if I have a number of static file routes, and an [...index].tsx catch-all to handle the CMS routes. Can't have another catch-all (right?) rough setup is:...

I get ERR_UNHANDLED_REJECTION

Hey all, I am using the solidstart drizzle example wiht login. solidstartversion: "@solidjs/start": "1.0.6", nodeversion 23.2 I try to run this code. ...

Vite keeps loading the packages first before @solidjs/router

Hi, is there any way to tell vite to load my custom package (that uses solidjs router as dependency) after loading the solid router? I kept getting errors like use-hooks must be called within Router

hook

Can I destructure my hook in SolidJS? It returns values via an anonymous function and doesn't lose reactivity. Is it bad?

Problems to acess objects inside an array

Hey guys, im trying to make a game with solid js using it as my interface library, but im having this weird behavior on createStore signal. I have this store: export const [spaceShip, setSpaceShip] = createStore({ name:"Galahdyx 5C", inventory:{...

Handling <input>

Is this a correct way to handle <input> fields? <input onInput={e => setUserName(e.target.value)} value={userName()} /> Or should I use a ref instead and read the field value when it is needed?...

Submission not reactive in JSX ?

Hi, I'm making a login form as such: ```tsx...

Solid/reactivity lint rule complains about async custom event handlers

Hello, I'm having some issues with solid eslint plugin regarding custom event handlers. ```ts const comp = <my-element on-click={async () => {}} /> // warns:...

Fetch on SSR is missing Cookie on request header

I am trying to do SSR with authorization session stored in HttpOnly cookie, as instructed by the best practices laid out on Lucia Auth documentations. It seems that on the current SSR rendering phase, the cookie header is not passed properly to GET API routes. I have filed associated GitHub issue here: https://github.com/solidjs/solid-start/issues/1675...

how to manage global signals interacting with other global signals properly?

Im an ex react dev (pre-nextjs takeover) and have been out of the game for a while. came back to learn solid as it appears to solve my then frustrations with react. Specifically, the crux of this question: handling of global state. My very basic understanding is to use signals simply outside of component scope. and contexts for more complex interactions. My issue however, begins when attempting to do something like the following:...
Next