SolidJS

S

SolidJS

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

Join

I'm having trouble with `session.data` being undefined

Starting from the with-auth example, user_id is sometimes undefined when e.g. refreshing the page. ```tsx const session = await getSession() const user_id = session.data.user_id ...

Right side of assignment cannot be destructured

This may not be a solid issue but I am really confused. I did not have this problem when I was using vanilla Javascript; however, switching to solidjs changed a massive amount of how the app functions. So I am trying build a tauri app and I have a command: ``` async function new_session({ name, temp }) { let msg;...

[Solid-Start] Issue with context who don't return the value

Hello I have a very strange bug with the new solid-start template : I have a library who is package with tsup and tsup-preset-solid : https://github.com/qlaffont/rosetty-solid When I try to import my provider to access to my context and call it in my app sometimes I can access to the context value and sometimes I got undefined If i rebuild with tsup -> It will work 1 time and the other time is breaking but no changes have been made on the code ...

Routes Component Not Available

Hey There! I'm very new to solid and am exploring. I've been trying to use the solid router, but run into a few issues. Firstly, the Routes component doesn't seem to be available for some reason. Error: Uncaught SyntaxError: The requested module '/node_modules/@solidjs/router/dist/index.jsx' does not provide an export named 'Routes' (at index.jsx:6:25)...

Accessing grandchildren

I'm using Astro, and I have an Astro component that passes children to a Solid component. I'd like to iterate over these children, but, unfortunately, Astro wraps them all in a <astro-slot> element. Is there a way to access the children of this element through props.children?

Unable to mutate data created by createResource.

I have the following code that i'm trying to get to work but it doesnt update the node/ui ``` const [tb, { mutate }] = createResource(...

Server background jobs / tasks

Hello! Is it possible to have "long running" jobs in the background on the server? For example to send an email every 5 minutes.

Dragging rectangles impossible? (tried to build a timeline component)

Hey, I wanted to build a timeline component where you could drag divs left and right with your mouse. It would be stored in a state and the rectangles would be rendered using For. However, it seems like something like that is impossible. At first, I tried to set the state like in react by basically taking the object that defines the dragged box, making a copy of it by spreading its contents, setting the new values, and assigning it back to the array in a map function that would replace the original object by index. That resulted in the rectangle component being unmounted immediately. So I tried preserving the references. That kind of worked but it does not re-render the list during the changes but only after the rectangle component changes its dragged state to false. Please, look at this example. Try dragging the rectangles and see what I mean. https://playground.solidjs.com/anonymous/2e4da24a-a2bd-4f87-abc4-5553d3f288af...

[macOS] Module '"@solidjs/router"' has no exported member 'cache'.

I wanted to follow the example for caching from https://start.solidjs.com/core-concepts/data-loading, but when trying to import the cache function I get the error in the title. I created my project with npm init solid@latest Has anybody any idea what I can do?...

I keep seeing this pattern in some solid code where dom refs are kept in signals.

```js function Button(props){ const [button, setButton] = createSignal(); return <button ref={setButton}>{props.children}</button>...

Need help in solid-router

my development ryan ```json { "@solidjs/router": "^0.10.5", "solid-js": "^1.8.7"...

`Request is not defined` when loading a page with the solid start (basic) dev server

I created a solid-start template with bun create solid, settings (basic, no SSR, yes TypeScript), but when I run the dev server and load the page, I get an error: [h3] [unhandled] ReferenceError: Request is not defined

SSG with `bun create solid`?

When creating with bun create solid, do I have to say yes to SSR if I want SSG? I've picked the template basic, and am unsure what to answer for the question 'Server Side Rendering?' as the quickstart guide doesn't mention SSG at all...

Is there a way to grab a throwed error in "action" function

Hello i have a question. I'm going more in depth into solid. But is there actually a way to grab the error that has been throwed inside an "action" function? i have a function like this ( example ): ```ts...

NPM Start Error + Beginner Question

I'm new to SolidStart, and I've only been doing web dev with NPM for a few months. Typically, in all of the projects I've been building, I use npm run dev to view my project on a local server. I watched Ryan's "SolidStart: The Shape of Frameworks to Come" stream on YouTube, and I noticed he was using npm run build and npm run start....

How Do I Turn On SSR?

When I started my project, I enabled SSR. I thought that was all I had to do. But in Ryan's "The Shape of Frameworks to Come" stream on YouTube, he edits the vite.config.ts file from: ```...

ReferenceError: __filename is not defined in ES module scope

I've created an app using solid-start and sucessfuly hosting it on my windows PC with no issue. But then I decided to change host to my Rasberry Pi 4 running ubuntu server. Everything went fine and I've managed to build my app again just like on Windows machine (environment is the same on both machine - node.js 20.8.10, npm 10.1)...

Struggling to get FileRoutes working

Trying to get the FileRouter working in a fresh pnpm create solid https://github.com/metruzanca/solid-fileroutes-not-working Keep getting hydration error in the console...

Move table columns around with drag & drop

I've created a data table component where you can move around the order of the columns using the drag and drop api. Specifically, I am using e.dataTransfer.setData to set the index on an ondragstart and read it during the ondrop event. It works as expected, at least on the first try, after that the behaviour becomes weird because it will always use the old index and not the new ordering. I've tried using a Index instead of a For, this solves the index issue but then the data will be matched with the wrong column....

How to import solidjs core as external library

I would like to delivery my code to browsers as 2 parts. The first part is solidjs core and the second is mine. So is there anyway to tell vite that treat any import * from 'solid-js' as import * from '/solid-js.js' in the browser? I saw an option moduleName in solid plugin for vite but not sure if it is the one I'm looking for as the build output didn't left solidjs/web out of the bundle....
No description