Madaxen86
Madaxen86
SSolidJS
Created by Sudhagar on 1/14/2025 in #support
Suspense not getting triggered although I am accessing the result of createAsync in my components
Can you share the complete component or make a reproduction on stackblitz (link is on https://start.solidjs.com
2 replies
SSolidJS
Created by quinnvaughn on 1/14/2025 in #support
How to share async data inside a context
You can also wrap you async function in query and use call it with createAsync in the layout and in any child component. Query will dedupe request. https://docs.solidjs.com/solid-router/reference/data-apis/query
6 replies
SSolidJS
Created by quinnvaughn on 1/12/2025 in #support
Question about actions + cookies
getRequestEvent should work. There’s an example in the docs how to set a cookie https://docs.solidjs.com/reference/server-utilities/get-request-event#response
17 replies
SSolidJS
Created by T. on 1/11/2025 in #support
Calling a "use server"; function in a ClientOnly component?
You can use just wrap it in createAsync and it will be replaced with an RPC call and returns the data in as an accessor.
3 replies
SSolidJS
Created by SleepPolar on 1/4/2025 in #support
Problem with text that jumps lines CSS
Yeah that’s when you‘d need to flip the anchor position. Libraries like floatingUI provide helpers for this. Or you just use a unstyled component library like https://kobalte.dev/docs/core/components/dropdown-menu which have all those details figured out and also provide accessibility, keyboard navigation etc.
7 replies
SSolidJS
Created by SleepPolar on 1/4/2025 in #support
Problem with text that jumps lines CSS
dropdown-menu a {
...
white-space: nowrap;
}
dropdown-menu a {
...
white-space: nowrap;
}
7 replies
SSolidJS
Created by ish on 1/1/2025 in #support
Pattern for "sticky" searchParams?
4 replies
SSolidJS
Created by batman✅ on 12/27/2024 in #support
Need help debugging this error: Client-only API called on the server side. Run client-only code in
There are known issues regarding vite 6 The plan is to wait for the new nitro version which will replace vinxi.
11 replies
SSolidJS
Created by batman✅ on 12/27/2024 in #support
Need help debugging this error: Client-only API called on the server side. Run client-only code in
Maybe try with vinxi 0.4.3 The latest templates are on this version https://github.com/solidjs/solid-start/blob/main/examples/basic/package.json
11 replies
SSolidJS
Created by batman✅ on 12/27/2024 in #support
Need help debugging this error: Client-only API called on the server side. Run client-only code in
Do you have a file with toplevel "use server" Which exports a query?
11 replies
SSolidJS
Created by Jason.json on 12/25/2024 in #support
Route for error 500
Errors are handled by ErrorBoundaries https://docs.solidjs.com/reference/components/error-boundary regarding "loading while the app is loading a route" you may have a look at createAsync and Suspense https://docs.solidjs.com/solid-router/reference/data-apis/create-async
5 replies
SSolidJS
Created by blazekids on 12/23/2024 in #support
SolidStart: serialization error when there is a default value in `createSignal`
The difference is that the browser is aware of the current hostname, while the (node) server isn’t. You can create a factory function which prepends the hostname for every fetch and you can put the hostname in .env If the env starts with VITE_ it will be available in the browser
12 replies
SSolidJS
Created by blazekids on 12/23/2024 in #support
SolidStart: serialization error when there is a default value in `createSignal`
More sophisticated and on your problem. During the initial load, fetchUser will be executed on the server, thus you need to add the host to the fetchCall e.g.
const fetchUser = async (id) => (await fetch(`http://localhost:3000/api/users/${id}`)).json();
const fetchUser = async (id) => (await fetch(`http://localhost:3000/api/users/${id}`)).json();
but you better use createAsync and query as they have more benefits like deduping, preloading etc.
12 replies
SSolidJS
Created by blazekids on 12/23/2024 in #support
SolidStart: serialization error when there is a default value in `createSignal`
12 replies
SSolidJS
Created by blazekids on 12/23/2024 in #support
SolidStart: serialization error when there is a default value in `createSignal`
12 replies
SSolidJS
Created by blazekids on 12/23/2024 in #support
SolidStart: serialization error when there is a default value in `createSignal`
Simple answer: use createAsync and query for data fetching in SolidStart
import { For } from "solid-js";
import { createAsync, query } from "@solidjs/router";

type User = { name: string; email: string };

const getUsers = query(async () => {
const response = await fetch("https://example.com/users");
return (await response.json()) as User[];
}, "users");

export default function Page() {
const users = createAsync(() => getUsers());

return <For each={users()}>{(user) => <li>{user.name}</li>}</For>;
}
import { For } from "solid-js";
import { createAsync, query } from "@solidjs/router";

type User = { name: string; email: string };

const getUsers = query(async () => {
const response = await fetch("https://example.com/users");
return (await response.json()) as User[];
}, "users");

export default function Page() {
const users = createAsync(() => getUsers());

return <For each={users()}>{(user) => <li>{user.name}</li>}</For>;
}
12 replies
SSolidJS
Created by coco on 12/21/2024 in #support
Passing signals as props in a Route component
Maybe
<Route component={(props)=> <ProtectedRoutes isAuthenticated={isAuthenticated {…props}
}/>}
>

<Route component={(props)=> <ProtectedRoutes isAuthenticated={isAuthenticated {…props}
}/>}
>

5 replies
SSolidJS
Created by coco on 12/21/2024 in #support
Passing signals as props in a Route component
<Route component={()=> <ProtectedRoutes isAuthenticated={isAuthenticated
}/>}
>

<Route component={()=> <ProtectedRoutes isAuthenticated={isAuthenticated
}/>}
>

5 replies
SSolidJS
Created by mileung on 12/19/2024 in #support
What does it mean when a tags don't navigate to their href?
Page refresh does not help? When you are afk for too long, the browser disconnects from vite. Simple page refresh will log vite connected.
7 replies
SSolidJS
Created by Jason.json on 12/18/2024 in #support
Solid Start offline indicator in mobile / desktop app
You can add it to app.tsx or create a layout at the root of the routes directory (assuming you are using file routes) https://docs.solidjs.com/solid-start/building-your-application/routing#nested-layouts
3 replies