SolidJS

S

SolidJS

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

Join

Server Side Fetching

Hi I want to fetch data from server side and render the title based on it's content like in PHP. I want to execute the fetch request to api from server side because I want to render the page to client when fetch is ready. ...

ServerSide fetching for metatags

Hi I am looking for server side fetching for open graph metatags. I want to execute fetch on server side and then render page with title and metatags filled in. If returned result from fetch has length of 0 redirect user to /404 page. My meta tags setup ```ts...

Throwing a redirect inside a query

When throwing a redirect from a query, the throw gets caught and returns undefined instead. The inferred return type is wrong in this case, but when throwing other values the throw is not caught. Is the query function typing wrong, or am I using query wrong? ```ts import { query, redirect } from "@solidjs/router" ...

Error when trying to use provider method

I have the following method setup in my /src/quickPlay/provider.tsx file: ```ts const stopAllSounds = () => { store.sounds.forEach((sound, index) => {...

actions: I can't tell if this is a bug or a feature

If I submit an action and then immediately re-route, the action is just gone. If the response is being streamed in, I can't observe the response on an effect from a component higher up than both the current and target routes. When I don't navigate, the effect in the higher component can see the data - no problem, but when a navigation occurs while the data is being streamed in, the effect stops reacting to the new content coming in. Remix had a similar issue with fetcher's (remix submissions) lifetime being tied to component lifecycle. They recently changed it with a future flag called v3_fetcherpersist....

Google AdSense with SolidStart

Hi I want to include google adsense in my solid start website. I think I've done everything what I had to do. My problem is that ads does not display on my page. There are just empty spaces for them to load. 😦 ...

Project Structure and Build Output Configuration

Hi there, I need assistance with configuring my project to build the output folder one directory above the current level. This setup is necessary due to hosting requirements. Specifically, my hosting provider mandates that the main JavaScript file (app.js) and package.json be located in the same directory, with the type field in package.json set to commonjs. Here’s the structure I aim to achieve:...

Component type

On the documentation I saw this example : ```tsx import { type Component } from "solid-js"; const MyTsComponent(): Component = () => {...

Help: Preflight OPTIONS Requests In SolidStart. I'm Lost!

The docs give the following examples for methods in API routes. ```typescript export function GET() { // ......

Problem in Canvas

Does anyone know why this problem happens? The size of the Canvas is 64x64, and the Tiles are 16x16.

How to prevent re-creation of a component inside <For>?

Hi everyone. To illustrate my issue, I created a very minimal version of the application that I have. To see the problem I am facing, just click on any of the links in the rendered page and then click on the button that appears. You will notice that the button will disappear (because the component gets re-created and the state is reset). What would be the best approach to prevent this from happening? https://codesandbox.io/p/devbox/r5k78c...

[error] Client-only API called on the server side. Run client-only code in onMount, or conditionally

I everyone I'm facing this error when try to deploy my website:
[error] Client-only API called on the server side. Run client-only code in onMount, or conditionally run client-only component with <Show>.
Already try to deploy in two places, without success....
No description

Deploy on Coolify

Hi everyone Anyone deploying a solid start project on a Coolify instance?...

Details on how client code and server code is split

Is there detailed documentation on how server code and client code is split into two different bundles and how module side effects are handled? I'm having some issues with a "use server" module apparently loading server libraries into the client and I'm not sure I understand why.

When does load and preload run?

I started a solidstart project I'm toying with and I'm not understanding some of the data fetching model. ```ts export const route = { load: async () => { console.log("load!");...

Solid Start Navigation

Hi, I've got a Solid Start page, and want to navigate to a different page within a component. I basically do the following:...

"Hydrate" custom HTML

I would like to make previously-static HTML interactive. As an example for what I want, suppose the server sends HTML like ```html <ul class="todo-list"> <li>Learn SolidJS</li> <li>Create TODO-App</li>...

Confusion about `"use server"`

I have a few questions related to "use server": 1. Should all server-only files be "use server"? If not, why not? 2. I see that you can export anything other than a function from a module that is tagged with "use server", what's the reason for it? 3. Does "use server" on a module expose all functions from that module to the public (e.g. they can be called from the outside in a RPC fashion)?...

`reload`/`revalidate` + other response (e.g. `json` or `redirect`)

I'm kinda confused as to why reload and revalidate has to be part of the response from an action. How can I both reload/revalidate cache keys and also redirect or return some other response from an action?

Best practice for fetching data and the transfer data to signals that I can can them in the input fi

import { createSignal, createEffect } from "solid-js"; function UserProfile() { const [user, setUser] = createSignal({ name: "", id: "" }); const [newName, setNewName] = createSignal("");...