SolidJS

S

SolidJS

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

Join

SolidStart - How do I build and start server in different directory?

After running npm run build, a dist folder w/ content is created. If I move the dist folder into another directory, I have to copy the package.json file and npm i --omit=dev in the new directory for it to run without errors. My confusion is why I'm having to manually copy the package.json file? Is this the correct way to do it, or am I misunderstanding? ...

Network issues with Solid

Running a solid SPA on localhost with backend server, using bun vite I am running all this in wsl. I am having strange issues with my axios api calls to my backend returning errors after certain ux paths and app pretty much freezing on hard refresh. If I rerun the server and frontend it will work fine until I do the same path or hard refresh after a certain path. I also get a strange error message after maybe 5min and the app just crashes it is: crbug/1173575, non-JS module files deprecated. (anonymous) @ VM10:6744 ...

API failing

Suddenly my API calls stop working using createResource and createQuery(Tanstack)

How do I lazily load stylesheets for different pages

I have a single page application with solid router: I have different routes loaded like this ``` ...

Trigger animation using Motion One for Solid

Is there a way to manually trigger animations using motion one for solid? The regular Motion library has an animation.play() method, but I don't see how to do the same think using Motion Solid. The problem I'm trying to solve is that I'm using Motion in a component, but the animation does not play when I pass that component to a second component as a child (props.children) and try to render it in the second component....

Accessing parts of a Store (sub store, substore)

I ran into some typing issue with stores. I've got a component that expects a data: T[] and setter: SetStoreFunction<T[]> . This is all fine when passing in a complete store as created by createStore(...) but breaks down if I want to pass a part around: e.g. ```tsx <Foo...

UND_ERR_REQ_CONTENT_LENGTH_MISMATCH error when navigating to index route

My index route looks like this ```tsx export function routeData() { return createServerData$(async (_, { request, fetch: fetcher }) => {...

Pass prop into style={{}} on hover

I need to send a hex-color into the styles that depends on my data, specifically ``` '&:hover': { color: props.color
}...

Global style tags get added before page is actually visible

I'm trying to get a better understanding of how data loading works in Start. It seems that when I have a <Style> tag in a layout, but the actual route takes a long time to load, the Style tag will still render even when the rest of that route is not. Here's the repro: https://github.com/nonphoto/solid-test-global-page-styles

Control when child component is mounted

I am creating a mega menu component which is used in the following way: ``` <MainMenu> <MenuItem title="Products">...

Client only component (or client only createResource)

Hey... I've a component that renders button depending on browser capabilities, so it makes no sense to use ssr. I would like to wrap the capabilities check inside a createResource to use suspense / error boundaries (the browser check PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable() returns a promise. ...

SolidStart on Plesk

Is it possible to host a SolidStart app at a hoster who supports Node.js via the Plesk "panel"? I have to specify a file to execute, would that just be dist/server.js?...

Best practice working with reactive values inside context provider

I did some experiments using solidjs context. Context as value is not reactive in solid.js. It's a little different from props that are reactive - if you pass signals as props like a={a()} to Child, and access props.a - a is reactive. If I wrap the context value in a function and treat context as Accessor<OriginalContextValue> - it's reactive. If I use a store it's reactive too (but the update needs to be done differently)....

Trigger same API call with different payloads in parallel using CreateResource

I am facing issues with making same API call multiple times with different payloads (using ForEach). I am setting a payload within the store at each iteration and that store proxy is used as a dependency of fetcher function inside createResource export const TriggerAPI = () => { const [dummy] = createResource(getPayload, fetcher); return dummy; };...

esm.sh & router

Hi all, Trying to get solid's router working with esm.sh and SSR in Deno. I've created an issue with esm.sh to support conditionals, but in the meantime does anyone have an idea besides manually bundling for the server? https://github.com/ije/esm.sh/issues/511 ...

Subscribe to

Given the derive signal feedback
const [store, setStore] = createStore({fb: [0,1,2]});
const feedback = store.fb;
const [store, setStore] = createStore({fb: [0,1,2]});
const feedback = store.fb;
...

Strange React not defined error

I've created the bare minimum solidjs + vite app with just and index.html and index.jsx page: ``` import { render } from "solid-js/web"; ...

I get `Invalid left-hand side in assignment expression.` when I assign a value.

I get the error above if I try to assign a value to selectedRate inside the onClick even with the arrow function removed, I still get an error. ```jsx const ratings = [1, 2, 3, 4, 5];...

For component not displaying values

What am I doing wrong here?? ```jsx import { For } from "solid-js"; ...

Component is called twice when using Suspense, createResource and solid router

Hi I have a component that uses createResource. When navigating to a route containing this component, it's called (reevaluated?) twice. Is this what is supposed to happen when using transitions (which the router is using)? Or is it a bug? Is there some documentation for how Suspense is supposed to work? I can try to create a self-contained example if that makes it easier to understand my issue 🙂...