SolidJS

S

SolidJS

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

Join

SolidStart Firebase error on production

I was trying to use firebase (10.1.0) on my SolidStart project, it works fine on Dev but getting error when I build and start it. The Error is shown in the picture. Also when I build there's circular dependency warning around grpc and protobuff.
No description

how to define event.locals type?

quick question, I'm trying to write some middleware to integrate pocketbase with SSR and I was wondering if anyone knows where (like in Svelte) can I define the type for my event.locals attribute?

Is it possible to untrack writes to a signal?

I have a certain use case, in which I have a function called getTextBoxValue which needs to run at a particular time. The way I control the execution of this function is by using a boolean signal called IsTriggerFieldChanged like a flag. So I set the value of this flag to be true, to execute my function. The problem is that within the function, I need to reset the value of the flag back to false for it to work a second time. However when I set the flag to false, it triggers a re-execution of my function (IsTriggerFieldChanged) which undoes the calculated value...

signal vs createStore vs createMutable performance for large objects

Goals: 1. A direct mutable vanilla-javascript-like interface to update complex objects 2. Performance for large objects OPTION A: undefined -> set hack...

How to initialize a store from another store?

I'd like to initialize a store (say store2) from another store (say store1). However if I change store2, I don't want it to affect store1. In the example below, I tried using unwrap but that didn't help: when a value in store2 changes, it affects store1....

Possible Bug with routeData

If I do this ``` // File PersonPage.tsx ...

Context Not Being Defined

I am running into a problem where the AuthContext isn't being defined in m app. Here's my App component: ``` const App: Component = () => { console.log("Rendering App Component");...

typing CreateResource

I would like to do something like this so typescript don't show an error when using it in jsx: const [data, { mutate }] = createResource<{ dataExample: string } | undefined>(() => getData("/api/Example") ); ...

<name>.server.ts file naming convetion ?

hello, I'm still kind of new to solid start, I was looking at the docs - into the session bit - and I noticed that it's using a filename convention of <name>.server.ts. Does this mean that whatever is written inside this file will only be run on the server or is it just convention to distinguish easily that which should be run on the server and that which should be run on the client ?

Plain string for <Link onload="..."> shows warning

I want to preload google fonts in the root.tsx like so: ```tsx <Link rel='preload'...

why is it possible to use singletons in astro but not solid-start?

when ssr'ing solid with solid-start it's advised not to simply import and export signals/stores, aka singletons, since this could create shared state on the server. With astro on the other hand, this is a pattern that's being used with p.ex nanostores and the like. Is this potential bug of shared server state simply not possible in astro? Will we be able to share global state with singletons once solid-astro makes the move to astro?...

Please, HELP with SSR

I have no previous experience with SSR and I am just starting my journey with Solid.js but looking at its docs is making me confused, I am really not sure where am I supposed to start -- do the 'hello world'. I hear people talking about rollup, webpack, in other contexts (like React) but I am feeling just lost. Have used Google and Youtube and also did not find good resources to guide me in that beginning with Solid.js' SSR, either. Sorry for this thread but I would rather look stupid than giving up. Does anyone recommend me some documentation or link where I can do a bare minimum functional SSR project with Solid.js?...

PocketBase Auth with Context doesn't track store

I'm trying to create a PocketBase AuthContext that I may add to my app, so that in the future if I wish to add more routes I can access the data from all the routes. However this is getting on my nerves, because the store isn't tracking when the pb.authStore changes (creation / deletion / updated), that is except when HMR kicks in, then it refreshes. And the weirdest part is I can log it on the console... Here is the code: ```const AuthContext = createContext<...
No description

How can I populate HTML on the server with db data before sending it to the client

Hello - i am new to solidstart and today as I was attempting to port a nextjs app into solidstart I was confused as to how I am supposed to handle data fetching in a page route. I need to render a page for my users on the server. In my specific use case I need some session data in combination with a call to the database. I used the middleware to verify a user is logged in and store the sessiondata into the 'locals' variable which I can access inside routes - but i still haven't found out how to make my async db call to work. I am using the 'isServer' var to run the db call only on the server but The routes themselves are synchronous so I cannot use await there, and when I use createReousrce I get no result on my page. (I know i can use an API call from the client or a server action but that is not the functionality I need)...

Proper implementation of a timer/stopwatch

I am struggling to understand how to properly implement a timer in a reactive library/framework like SolidJS. What I want is 3 buttons: - start - reset - stop I need to represent time in ...

No Vercel Logs

Hi! I've deployed a solid-start app using Auth.js which I originally generated using create-jd-app to vercel. Trouble is my serverless functions are not working at all /api/auth/session just produces...

Prevent re-render <table> element when changing array in store.

is it possible to prevent re-render whole table element when i splice element from array in store? Table has a hundreds of rows where each row is an array item in store. when delete some items from array will re-render whole table. And it takes some time. I need just delete some <tr> element from DOM. Thanks!

Is <HydrationScript/> required even if I'm not utilizing SolidJS' SSR?

In my project, the Uncaught ReferenceError: _$HY is not defined is shown when I'm not using <HydrationScript/>, but looking through the Discord server messages, I get the feeling that <HydrationScript/> is only used if I plan to have SSR, which I don't since my project's tech stack is Astro + SolidJS. I also don't recall <HydrationScript/> being mentioned in the tutorial of the new docs website, and the documention for <HydrationScript/> doesn't say if this is required in every project or only for projects that use SSR. My project still runs as expected with or without <HydrationScript/>, but it'll be nice if the confusion on the usage of <HydrationScript/> gets cleared up....

Building with SSR false starts (and doesn't close) listeners

In my app I create a WebsocketServer on Port 3001. If I run npm run build with default SSR setting (ssr: true) everything works like a charm. However, turning off ssr, the WebsocketServer gets started and not closed => EADDRINUSE error. Cannot run dev or start afterwards. ...

SolidJS: Manually using SSR with v8?

Hi, I am working on a project which has a PHP back-end, but which has access to a PHP V8 (https://github.com/phpv8/v8js) module, which means I can perform some sort of SSR behind-the-scenes and render the HTML/javascript before the page load- I'm curious if that is at all possible to accomplish using basically just V8 and solidjs in this way? I mean, I can use renderToString to extract the HTML, but I also need to generate and render the javascript which accompanies my page, in order to allow it to be interactive....