SolidJS

S

SolidJS

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

Join

What's the best way to make a docs website?

I'm building a SolidJS library and want to make a simple docs website for it. I'm hoping to leverage an existing library (not necessarily specific to Solid) for the scaffolding so I can focus on writing the contents of the docs. What do people recommend currently? Docusaurus? Vitepress? If so, how do I go about using Solid with these libraries? Thanks!...

solidjs/testing-library using `location` but still getting <Router /> error

Hey, I am currently trying to setup on of my solid-apps with solidjs/testing-library. I want to test something on my main route, and am therefore using the location option. However my test still throws the Make sure your app is wrapped in a <Router />-error. Any idea what I could be doing wrong? ...

Any way to get the status of a multipart/form-data file upload?

I would like to be able to give the user some indication of how much of their file has completed uploading. As per the title, the form is of type "multipart/form-data". Is there any way to do this? Maybe some way to count the number of bytes sent?

regex in useMatch

Is there a way to use a regex in useMatch? I would like to match /book/2 ... but not just /book

How to deploy unplugin-icons on production?

For a SolidStart project, I'm using this library https://github.com/antfu/unplugin-icons as Icon Components. I follow the instructions in the page and have it working on local perfectly. However as I deploy to production, using Docker, I got this error ```...

Make a Resource depend on another Resource

I would like to have a resource depend (awaiting) on another, like so: ```ts const [resource2] = createResource( async () => {...

vanilla js in onMount?

I got help recently about finding a way to import a vanilla javascript file as an independent source https://discord.com/channels/722131463138705510/1116600411311317032 and It worked on the initial load, but using the back button would cause many problems. Now, I have moved to putting lots of plain js in an onMount, which is working well so far, but seems like a bad idea. Does anyone know of any issues that could be caused by that method?...

Empty event with useRequest()

I'm getting an empty event (no properties on the object) via useServerContext() even when isServer is true. Is that ever supposed to happen? I'm using the cloudflare pages adapter if that narrows it down.

Example of using createWebSocketServer within an API endpoint with SSR: false

Is there a simple example of using createWebSocketServer within an API enpoint? Current with-websocket example seems to only work with SSR: true

Solid Bootstrap Data Table

Hi Im looking for a custom solid-js data table solution. To minimize my workload, of course I believe boostrap could be the best way. But at the same time, I also wish to have a customizable solution. So that I can add on the functionalities I want. May I know is there any one found out a better solution for a data table in solid js?...

How to get `useParams` in the "root.tsx" in a server-rendered-page.

Inside the root.tsx before any FileRoutes are resolved, how can we get the full path / the params for the current html-request? When I use useParams().id inside the root.tsx, I always get undefined....

[Solid-start]FileRoutes] is there a way of using two separate Routes folders in `root.tsx`

E.g., my main content should be Client-Side rendered, but the headers should be server side rendered for every route,s o what I would like to do is: ```jsx [root.tsx]...

How to call for server-side-data in the `root.tsx` of solid-start`

Since I want to wrap my entire site in <ClientOnly> in the root.tsx, I can't use useRouteData as that is only supposed to be used under the /routes path. So basically ```jsx [root.tsx]...

Any tools for SolidJS that you wish you had?

Hey everybody, My team and I working on an open source project with some restrictions; one of them being that we cannot iterate on an existing project. I think Solid is great, and I would love to contribute something worthwhile. Any input would be appreciated.

Router Error when on a server with lazy loaded component on root page

When I deploy my website on a webserver and I load the "/" route I get an error in the browser console saying: "Make sure your app is wrapped in a <Router />". I get this message again when I try to navigate to another route. But I only get the error when loading the root page first. When loading a different route first and navigating to the root page everything works. Also I only get the error on my server not when testing locally and I can put in a Component from a different Page and it still doesn't work. My work around is not lazy loading the Component for the root page which works but increases the size of the index.js on every page....

Runtime Env vars in vite

Hey all, I'm trying to figure out a way to run environment variables at runtime rather than at compile time. I've been looking at https://iendeavor.github.io/import-meta-env/ , but I can't seem to get it to work. Specifically, in transformMode: "runtime" , trying to use this code in a script called by index.html (in fact, a script tag in index.html) just makes global.import_meta_env to be the placeholder, it doesn't get replaced. ```html <script> globalThis.import_meta_env = JSON.parse('"import_meta_env_placeholder"'); console.log(import_meta_env); // import_meta_env_placeholder...

Await for signal state?

My website checks the login state upon initial load and a Resource on a page is failing to load because it requires login but it runs before the login check can finish. How can I wait for the logged-in (signal) state to change before proceeding with the request? I've looked at the from documentation but it's very confusing....

Resource from async generator?

Hey everyone, brand new to SolidJS. I'm working with a library that uses an async generator to return the current state, and then await for any updates (or errors). This is close enough to a resource that I figured it would make sense to wrap the generator. ```const gen = props.player.broadcasts()...

Solid-Start + GraphQL session info

Hi! I have a GraphQL handler at http://localhost:3000/graphql and I want to get session info by calling getSession inside of it but when I do it I receive no data (I do get session details when I call it on pages with createServerData$). Is it expected behavior? If not, what are the ways to debug it (I'm somewhat new to this)? ...

Losing reactivity in props passed to `children` callback

I've got a component Field that passes a memo to props.children. I'm running into an issue where the child component is not updating on changes to the memo ``tsx export function Field(props: { form: Form; children: JSXElement }) { // Form` is a SolidJS store const fieldState = createMemo(() => {...