SolidJS

S

SolidJS

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

Join

typing Page props ?

is it possible to type the props for the page? I'm tryna to block the page until render, and the best I've come up with is: ```tsx const load = cache( (userId: string) => api.getSelectionsByUserId(userId), "selections"...

Infinite context loop in start dev?

Hi, I have ```ts const [MeProvider, useMe] = createContextProvider(() => { let [me, { mutate: setMe, refetch: refreshMe }] = createResource(async () => { // this runs forever console.log("running!")...

how do form actions revalidate data?

I never call revalidate but the boards get updated nonetheless, does form submission revalidate everything? ```typescript export default function Home() { const boards = createAsync(() => getBoards());...

Footer

Hi everyone. I'm trying to create my footer using a context that I have for SEO and retrive my social networks from Sanity CMS, but I'm facing the error on the image The component code is on the thread. Can anyone help me?...
No description

nested layout

is it possible to make the file structure like follows: ``` - routes - (user) - layout.tsx...

what does returning an error from a server function do? I don't see it in the console anywhere.

I see the documentation recommends returning an error instead of throwing it, what does that do actually? where can I see the error? how can I handle the error on the client and show a toast or something else

is "use server" necessary for form actions in solid start?

the documentation doesn't include "use server" but I couldn't get it to work without that directive. Just trying to figure out if it is a bug or intended and the documentation needs to be updated

How does useSession work from vinxi?

I am not sure if it's documented anywhere how does it actually work, my questions - does it set cookies? - what is the secret passed to the config for - is it jwt?...

how to redirect from form actions

I want to redirect to the index page from signin form action on successful with Any insight would be helpful My current code doesn't redirect...

Endless "[vite] ✨ optimized dependencies changed. reloading"

Could anyone explain why it takes an exorbitant amount of time to optimize dependencies after installing any package from npm/pnpm/yarn? This issue seems to occur randomly during development and provides a terrible developer experience (DX). Additionally, if I manually stop the dev server and try to run it again, it just says: ``` [get-port] Unable to find an available port (tried 3000 on host "localhost"). Using alternative port 3001....

Need help debugging animations

I had a brilliant idea for implementing an animated responsive tab bar component, but I need help debugging animations. Explanation The idea is as follows: instead of making the indicator reside in the tab bar element, move it inside the currently active tab. This way if the tab changes its width the indicator will resize as well. To animate it, we need to calculate offsets (left and right) of the previous tab relative to the current tab. If there are multiple ongoing animations we need to readjust each single one (create a new animation relative to the current tab and set its currentTime to the time of the animation we are adjusting)....

Caching server-side render results

How can results of server-side renders be cached for consequential requests? I assume this would need renderToStringAsync on the server, but SolidStart always renders with renderToStream, even in async mode 🤔. (https://github.com/solidjs/solid-start/blob/65c8ac0844ffac42947773e6d529e307ac687513/packages/start/src/server/handler.ts#L99)...

importing static assets (telling vinxi/vite about stuff other then png's)

Every other month, I feel like i'm facing this again. How to import static assets in solidjs? The docs https://docs.solidjs.com/solid-start/building-your-application/static-assets say: ...

Precache service worker

Is there any way to implement service worker for content precaching? For context I'm creating a website with a midi player. It would be great to precache large (1 to 21 MB ish) SoundFont files. I've tried using VitePWA plugin in Vinxi. It doesn't appear to register any service workers though. ...

Failed to parse URL from after refreshing page

I am using solid-start with bun. I created a page where i am fetching data using createResource. I have index page which redirects me to /page/<id>. And then I am fetching data using this id and it works fine. But then when I am refreshing this page i get this error TypeError: Failed to parse URL from /api/data/<id>

Offline Documentation?

Is there offline documentation available for download? Hoping to sink my teeth into it on a flight with no internet.

"?raw" imports don't work with vercel

The vite ?raw suffix syntax for importing static assets as a string does not work correctly when using vercel. Instead of importing the asset as a string, it imports the url of the file as a string as if the ?url syntax had been used.

CSS dropping on navigation to nested [id] route

I am navigating using <A> and my css drops. It only drops if I navigate to the route, if I am at the route and do a hard refresh the css loads fine. Not sure what is causing it there are no error messages anywhere I have tried it on all browsers same behavior....