SolidJS

S

SolidJS

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

Join

vitest error 'registerGraph'

Hello, have you encountered the following error? ```sh TypeError: Cannot read properties of undefined (reading 'registerGraph')...

Maximum call stack size exceeded while using createEffect

Hello! I'm trying to fetch data from API endpoint and fill in the store values using createEffect
```js function AdminUserChange() { const parentUrl = '/admin/users'; const params = useParams();...

Anyone one have any insight on how to integrate a Meta/FB Pixel with a SolidStart site?

I saw resources how to implement it with next but, the package seemed slightly different from SolidStart

How to set a url for the Solid router on backend (SSR) side?

How to set a url for the Solid router on backend (SSR) side?

Increment counter every time component is used?

Currently I use context to to have signals for this counters but is is possible to get this without context or imported signal? <Thing/> <Thing/> <Thing/>...

how to add debounce to any signal setter ?

I have use case where my my signal is getting called multiple times which is fine as per the implementation. But what I want is to debounce that seignal setter so that it is call in deferred manner and its fine if few calls are missed.

Add props to an element programmatically

In one of my components, I pass an element as a prop, although I'd like to add the class argument to it in order to style it. ```tsx import styles from "./css/MyElement.module.css"; interface Props {...

Is possible to use Solid Router on SSR side?

Is possible to use Solid Router on SSR side?

addEventListener not working?

Hey there, I'm kinda new working with SolidJS, I've worked with React before and have a lot of experience in plain HTML + CSS + JS without framework. But I was trying to create a hovering effect on my cards by adding a JavaScript function to rotate it in '3D'. The problem is that when I add an event listener, it never fires off even when meeting the condition to trigger it. Here's the code: ```...

Dynamic Fragment

Is it possible for me to create a Fragment <> </> with the <Dynamic> tag ? Does Solid export a Fragment component that I can pass to Dynamic ?

Handling rerenders when overwriting state

I have a signal that is storing a 2d array for my 'game state'. What would be the best way to render this data without causing the components to rerender on each update. Ex. ```js const [state, setState] = createStore<{...

Disappearing button text?

I have a Button component whose text disappears - it initially renders, then goes away. The text node itself is gone from the DOM. Can't understand what's happening. Repo #1 is a UI library package. It has a Button component: ```...

`ERR_INVALID_ARG_TYPE` on solid-start build

Getting this error. Not sure what's wrong with URL passed to rmSync because it should be supported in node 17. ``` solid-start build version 0.2.26 adapter vercel...

Only able to get one value from multiple checkboxes that are checked

In my form, I'm only able to get the value of one checkbox that's checked, even if I check multiple check boxes. I have a form setup that successfully gets values from inputs. Some of the inputs are checkboxex that I make like this: ```...

Trying to test a component containing a createResource

Hi! I have a component that shows some content I fetch using createResource. I wrapped the JSX in a <Suspense>, also tried with <Show when={myResource()}>, which works in the app. But when I try to test the component, it seems like myResource() is undefined, even though I mocked my fetcher and made it return Promise.resolve(someMockData). With <Show>, the data was just never showed. And with <Suspense>, I had errors saying that the data I wanted to display was undefined (myResource().someAttribute for example). ...

Troubles Reading / Writing search params using solid-router useSearchParams()

Hello, I have some trouble reading/writing an array of search params using solid-router/useSearchParams() primitive ```jsx // for an URL like ?plop=a&plop=b function MyComponent () { const [searchParams, setSearchParams] = useSearchParams()...

Content Security Policy Issues

When attempting to deploy with docker I get these errors in the console Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”). and Content Security Policy: The page’s settings blocked the loading of a resource at http://localhost:4173/favicon.ico (“default-src”). ...

Build process stalls when global variables present

I am using solid-start and cloudflare-workers plugin for vite. I have API secrets that I defined within cloudflare. My problem is that my build process gets stalled when I define variables using these secrets, like so:
const secret: string = import.meta.env.DEV ? (process.env.SESSION_SECRET as string) : SESSION_SECRET
const secret: string = import.meta.env.DEV ? (process.env.SESSION_SECRET as string) : SESSION_SECRET
...

Unexpected token in testing render method

Hello, I'm just trying to test something and experienced with this problem. I follow the guide from https://docs.solidjs.com/guides/how-to-guides/testing-in-solid/vitest#creating-tests I can't get why that problem happens....

Module Federation inside a Monorepo

I have a Monorepo with multiple Solid Projects. I want to host some components inside one of them to use them in another. The motivation for this is, that the deployment for one of the projects is quite a long process. So I just want to import a "tab" component and be able to edit it remotely.