SolidJS

S

SolidJS

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

Join

solid styled starter template(solid-start) bug

It is showing the whole style tag in browser along with applying it. I have attached the screenshot too.
No description

useParams not updating with urql's createQuery

Currently refactoring a svelte project to Solid. I'm unable to get params to update inside the createQuery() call when you change the dynamic path (ie same route but different fst), which uses urql's solid library. I've tried multiple different variations of making params reactive and none of them seem to work. As you can see in the svelte snippet there, I had to make it derived state so it would update, but the equivalent of const derivedParams = () => params doesn't seem to work. Any thought...
No description

Suspense not getting triggered although I am accessing the result of createAsync in my components

``` <Suspense fallback={ <div class="flex-1 items-center justify-center"> <DottedLoader color="#999" from="checkout suspense" />...

How to share async data inside a context

I'm currently refactoring a website from Sveltekit -> SolidStart. I'm currently working on the layout for our dashboard As you can see in the sveltekit layout, I request some data via a graphql client I wrote that is then available that is then available in the load for any child routes as a typed object. Very nice feature. Obviously you would do this with a context in Solid. You can see the code I currently have which gets the data for the sidebar, based on https://docs.solidjs.com/guides/fetching-data#calling-multiple-async-events, but it's not currently set up to have that data be in the context. I tried refactoring the createQuery (urql/solid package, under the hood it's basically a createResource) to be inside a context but it didn't seem to want to be reactive. Any knowledge of how to do this correctly so that it updates when the data is loaded/I don't have any hydration issues? The context documentation only showed examples with local state....
No description

onLoad event doesn't trigger

Hello everyone. I ran into the issue, that the onLoad event on an <img> does not trigger. Here is the code in question: https://stackblitz.com/edit/github-a9ukgq-25tgxa?file=src%2Fpages%2FHome.tsx,src%2Fcomponents%2Fcomp.tsx,src%2Fcomponents%2Fcomp.css...

Getting UnhandledPromiseRejection in Solid Start server function that stops dev server

I have an async function in my Solid Start app and am receiving the following error message whenever it returns an Error. ```ts UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<_Response>". at throwUnhandledRejectionsMode (node:internal/process/promises:392:7)...

Question about actions + cookies

I'm currently trying to port over our company's website from Svelte 5 -> Solid, and I wasn't sure how to replicate this picture in an action. setCookie needs an event to be passed in, and as far as I can tell there's no clear way to get the event. I already tried getRequestEvent and that returned undefined, so I'm a bit stuck with how to do this. Would I have to do this in an API route only? Sveltekit also has those but I didn't have to use one for this, you just get the request and cookies...
No description

"Issue Handling Query Parameters with Slashes (/) in SolidStart URLs".

"I’m building a SolidStart application, and I’m encountering an issue with handling URLs that contain query parameters with slashes (/) in their values. For example: http://localhost:3000/organizations/45 works perfectly because it uses path-based routing. http://localhost:3000/organizations?o=1/45 does not work as expected since this is exactly what i want. It seems like the / in the query parameter ?o=1/45 is being interpreted as part of the path instead of part of the query string.the url gets updated in the url search bar of my browser but the page does not update. - I tried encoding the / in the query parameter as %2F, so the URL becomes http://localhost:3000/organizations?o=1%2F45. However, this still doesn’t work....

@solidjs/router not working

Please can anyone help me out, i have been stuck for days... as i have this issues
No description

createSignal vs createStore

When should createSignal be used instead of createStore and vice versa? If I want to store an object in state, for example: ``` const user = {...

How to change base directory

I want to deploy my website on a subfolder of the url. Right now, I have it deployed on my-site.netlify.app I have a website on my-domain.com...

Calling a "use server"; function in a ClientOnly component?

Hi - can a ClientOnly component call a function defined in a "use server"; lib file? Will the call be translated to a fetch to the server?

Unable to run any vitest tests on initial launch

I created a new solid start project via bun create and added the default vitest setup. I was trying to just see if any test would run, and I'm getting this error. Anyone know how to solve this? I haven't touched any defaults yet.
No description

context

Hi all, I have a question about context scoping. ```typescript import { render } from "solid-js/web"; import { useContext, createContext } from "solid-js";...

How to ideally protecting routes with Layout

I was using Solid Start with auth js, everything fine. But when i look the server log, it was called twice.
[login]-> [getSession & wrap in server fn with key]-> [call in layout]-> [also call in page]-> [called twice]
[login]-> [getSession & wrap in server fn with key]-> [call in layout]-> [also call in page]-> [called twice]
...

solid-start is unable to resolve import aliases

I've added some import aliases in tsconfig.json file. The typescript and IDE part correctly resolved it. It didn't work in the solidjs server tho. So, I modified the app.config.ts. Here's my updated part. ``` export default defineConfig({ ssr: true,...

Throw redirects in data APIs with "use server" at the top of the file not working.

Hi everyone! 👋 I'm working on a Solid Start project and have a question about query behavior and redirects. I have a query called getIdentity, which fetches user identity from cookies and db. The goal is to call this query on the /account page to check the user's identity. If no identity is found, I throw a redirect to /signin....

Efficiently Managing Supabase Sessions and Context Sharing in SolidStart

I am developing an application using Supabase and SolidStart, and I’ve encountered some challenges related to session management and sharing a Supabase instance. My Scenario 1. Session management after user login: • After a user logs in, Supabase returns sessionData (including access tokens, etc.)....

Difference between Soild/Signals & Preact/Signals?

Seems the SoildJS/Signals is still alpha (strange since Soild has been around for years), & PreactJS/Signals is now 2.0 Anyone know the performance & DX differences please?...

Containerized Solid Start Deployments

I'm new to using Solid Start and full-stack frameworks -- I usually create "vanilla" app architectures (e.g. a Solidjs SPA paired with an Elysia backend-for-frontend layer). With those vanilla setups, I could containerize the deployments using Dockerfiles and reason about them very easily. However, for Solid Start, I'm not sure how to reason about them fully because there are gaps in my knowledge. The intent I have is to create a containerized Solid Start deployment that I could run anywhere (Azure, AWS, GCP, etc.). In my app, I am using a database (SQLite + Drizzle ORM) and Better Auth for authentication/authorization (it adds tables to the database mentioned earlier). I would also like to use Bun for my runtime -- unsure if this is a wise-decision if Bun isn't supported fully across hosting providers. I had the following Dockerfile but unfortunately it does not work as the docker build chokes when attempting to install the better-sqlite3 dependency I have in my project:...