Madaxen86
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
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
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
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
Pattern for "sticky" searchParams?
You can also have a look at useBeforeLeave
https://docs.solidjs.com/solid-router/reference/primitives/use-before-leave#usebeforeleave
4 replies
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
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
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
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.
but you better use createAsync
and query
as they have more benefits like deduping, preloading etc.12 replies
SolidStart: serialization error when there is a default value in `createSignal`
Or of you prefer a video:
https://www.youtube.com/watch?v=Qw9am5NL6AI
12 replies
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