SolidJS

S

SolidJS

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

Join

Route for error 500

How can I make a route for error 505 in solid start? I made a file [...500].tsx

How to better handle resource errors when component is instantiated outside of the render function?

Hello, merry (early) Christmas! I have a somewhat unorthodox application with an SSR entrypoint that currently uses renderToStringAsync() to render an application. In hindsight, it was obviously problematic, but at the time, I was tearing my hair out trying to figure out why my application was having an internal error....

Canvas Lags

```jsx function generateTransparentBackground( canvasBackground: HTMLCanvasElement, individualPixelSize: number, c1: string, c2: string, canvasWidth: number, canvasHeight: number ) {...

invoke navigate() after function call but before signal update propagates to ui

i have this function ```tsx const handleJoinGroup = () => { const g = group(); const user = session.user(); if (!g !user !user.username || isMember()) return;...

SolidStart: serialization error when there is a default value in `createSignal`

Hello, I am trying to learn solid with the async resource tutorial: https://www.solidjs.com/tutorial/async_resources but with an api route in the app. The api route is just a simple GET with the same thing. I created https://github.com/mingchia-andy-liu/solidjs-test as MVP. Whenever there is a default value in my component. npm run dev will throw an error. ``` cause: j [Error]: Seroval caught an error during the parsing process....

Trouble getting `createEffect` to work outside the browser

Could someone help me get this [1] example from the docs working in node, outside of the brower? I've tried a bunch of stuff, including wrapping it in createRoot() [2] without success. [1] https://docs.solidjs.com/reference/basic-reactivity/create-effect#:~:text=//%20assume%20this%20code,//%20goodbye ```ts...

Passing signals as props in a Route component

Hello, I'm trying to render children elements of a route (solid router) while also passing signals as props in a route component. My current implementation looks like this: ```js <Route component={() => <ProtectedRoutes isAuthenticated={isAuthenticated} setIsAuthenticated={setIsAuthenticated}>...

TypeError: Cannot read properties of undefined (reading 'when')

Has anyone seen this error before? Getting this error coming from the Switch component internals Some extra details: - There's no other children under the Switch apart from 4 Match components...
No description

redirecting from API route

Hey all! I'm trying to redirect to a page (/app) from a API get route after exchanging the token with supabase. For some reason it works when using locally and it behaves correctly, but it doesn't wotk when deployed (on Vercel). Am I doing something really wrong / missing something? I've even tried to manually return a response instead of using the redirect but the behaviour is the same....

How do I manually implement hydration for a component?

I want to add markers / hydration labels myself, so that I can render it on a server in one way, and on the client in another. The DOM is slightly different between the two and causes hydration mismatches for Solid....

Need help to convice developers to go to SolidJS

Hello, a little question, currently we want to migrate our React App to Solidjs but we have some developers who don't think the changes is relevant. Can someone have some blogs / testimony about people who have made the changes ? (Ideally how) Thanks !

What does it mean when a tags don't navigate to their href?

I have a tags with valid hrefs and they're not disabled or abything like that but sometimes when I click on them, the solid app doesn't navigate to the new route. The way I get around this is to disable scripts or to restart the dev server. How do I prevent this annoying behavior? "@solidjs/meta": "0.29.4", "@solidjs/router": "^0.15.0", "@solidjs/start": "^1.0.10",...

Solid Start offline indicator in mobile / desktop app

Hi I am looking to include <OfflineIndicator/> in my app when the user goes offline in mobile / desktop app. Is there any way I can include it on all of my routes or I have to include it myself all of them?

Different server context when using "use server"?

Hi, I was trying to create a simple game project where player lobbies would (for simplicity) be saved on the server. Then I wanted to create some RPC using the "use server" so I can for example check whether the specific lobby exists etc. But I encountered that the state of the variable differed in the RPC functions and the rest of the server context, let me show an example on random number variable. src/server/number.ts...

Is there a 'useTransition' React hook equivalent in Solid?

From what I understand, useTransition for managing concurrent rendering, where you want to prioritise rendering some UI or others. Can we achieve a similar effect in Solidjs?...

Dynamic meta <Title> not updated on routes Solid-start SSR: false

app.config.js import { defineConfig } from "@solidjs/start/config"; export default defineConfig({...

vite-plugin-solid errors when doing `prop:x` instead of `prop:x={bool}`

Hello! I am attempting to use @material/web with SolidJS. Everything works pretty good so far but there's one issue that bugs me. ```jsx // Doing this works <md-filled-text-field prop:required={true} /> // But this results in an error!...

Detect when client closes a connection that is being streamed from a server function

I have a server function that, when called from the client, yields data back to the client from a generator. This data stream is supposed to be continuous over time, with the restriction that the user can make a request that stops the stream (via a server function and in-memory cache). The problem I currently am facing is that if the user disconnects (leaves the page, drops connection/internet somehow), the stream remains open (server logs verify it still attempts to send data back). Is there a...

dealing with data shared between pages

this kind of seems like a common question among meta frameworks w/ routing built in of, "how do i share data from one page to the next". in this case, the cache doesn't help as this really only dedups for a single round trip more or less the scenario i'm dealing with, which i would appreciate advice, is follows: i have a dashboard page where i fetch all of the groups the user belongs to, and i display them as cards. if the user clicks a card, it brings them to /groups/[groupId]. here i render out a heading with the group name (which of course i already fetched on the previous page) and then all the rest of the page, which takes a bit to render due to fetching im waiting on. it is a nice touch if the heading renders while the rest of the page loads via suspense. this seems like a no brainer as i already have the data i wanna show.. i just don't know the best way to get it where i need it...

weird history/url derived state behavior when using mouse back button

kind of a weird issue. basically i have a modal/dialog for which i derive open/close state from the url as the source the general idea is in a hook i grab the search params, and then return a memo'd state method that parses the params and returns whether or not the dialog is open based on that. then some open/close methods too. it was seemingly working really nicely and i thought was an elegant solution, ux and dx. however, i'm noticing that the back button i have on my mouse, when trying to go back to closed state, does not work. the modal closes on button down, and then comes back on button up....
Next