SolidJS

S

SolidJS

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

Join

Vinxi conditional config by mode

Is there a way to set up app.config.ts to be aware of the mode in which Vinxi is being run? When using Vite directly, the following is possible: https://vite.dev/config/#conditional-config It does not appear that SolidStart's defineConfig is similarly capable of taking a function that is aware of the mode in which Vinxi is being run....

SEO not working when sharing

Hi everyone I'm facing a few issues on my Solid Start project. The meta tags aren't correctly working when I share the link or when I go to the facebook sharing debugger, the meta tags doesn't match.
Please see both images
...
No description

Background jobs in Solid Start

Is there a way to run background jobs in Solid Start? Any server entry point can suffice since I can just set it up via node-cron or similar libraries....

Sessions broken on external hosts ?

Hi, I'm making a web-based game and I use the sessions to store the player's information (but most importantly the player ID) which I then use in various async querys to display the user's score and name for example. The session is created by the user first being prompted to choose a name, which is then sent to the server with an actions. If successful, the player object is returned and all querys are invalidated so that the page transitions from "must create name first" phase to "can now play" phase. This has been working great both in dev and production modes for now. But after deploying to the remote test host it is now impossible to get past the "Please choose a name" screen. This only occurs with hosts other than localhost, meaning that if I open the web page on the server, it works fine. But if I open from another computer on the network, the aforementioned issue occurs....
No description

Is `load` function a mistake for `preload` function?

https://docs.solidjs.com/solid-start/building-your-application/data-loading#data-loading-on-the-client I found the "load function" in the bullet points of the document. Is load function a mistake for preload function? ...
No description

How to use useSubmission in layout?

So I have a submit button in my sidebar as such I've created my app.tsx file like so ```ts import { Router, useSubmission } from "@solidjs/router"; import { FileRoutes } from "@solidjs/start/router";...

How to keep an active item for a list of items in SolidJS?

https://stackoverflow.com/questions/79209391/how-to-keep-an-active-item-for-a-list-of-items-in-solidjs My app has a list of items where each item is an object, and one of the items can be in active state. I'm using SolidJS. My first idea was to represent the whole state of the app in a store:...

Reactive conditional rendering based on Store of objects

Heres an example of what I am trying to do: ```typescript import { For, type Component } from "solid-js"; import { createStore } from "solid-js/store";...

Rendering <input>s in <For>

How can I reference a dynamic number of <input>s to read their value? Thanks....

Does createAsync cause double renders on the server i.e an extra render after data becomes available

Was observing from the logs ``` (procirement) route ProcurementProvider getProcurementRouteData...

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...

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. ...