SolidJS

S

SolidJS

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

Join

how can I see console.log output in Solid Start server actions?

I have an action like this: ```tsx const myAction = action(async function myAction(formData: FormData) { console.log(formData.get("image"))...

Need help debugging this error: Client-only API called on the server side. Run client-only code in

My solid start project works fine in dev mode, but when I try to do vinxi build followed by vinxi start I get the below error: ```bash npm run start ...

My solidstart app just hangs if I use process.env on any place

I'm having weird problems with my solid start app, like the page loads, no error from the terminal or browser, but it was like the javascript code does not run at all, no logic is executed, for example: I have a login page with two fields, and use @felte/solid for validations and initial values, everything works until I import the following file on any of my files: `import { z } from 'zod'; const schema = z.object({ API_BASE_URL: z.string().url(),...

Changing baseURL based on production and window.location.href

I have an API calling function that builds URLs like this: ${baseUrl()}/api/[...]. The baseUrl function looks like this: ```ts...

useTransition not working

Hello , I am trying to utilize useTransition but Im not sure if I am doing anything wrong or haven't understood how it works. ``` import { createSignal, useTransition } from 'solid-js' export default function Counter() {...

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