SolidJS

S

SolidJS

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

Join

Can't initialize SolidStart

I have problems with initializing project using npm it logs "directory not empty rmdir /{foldername}/.project" while there's nothing in the folder at all, I ran ls -a but nothing odd shows up Above problems happen only when building non typescript project, while with typescript it builds it well...

How do you refresh a non-solid children?

I'm using lexical editor inside one SolidJS component. It is initialised using ref={ref} + onMount(). It works correctly, mounts, unmount cleanups, etc. everything is fine. Now I need to programmatically clear it's content from a global store. I see two solutions:...

Do I still need `/* @refresh reload */` even if I have `"vite-plugin-solid"`?

Hi đź‘‹ This is from npm create vite NOTE: AI said no...

Different routes using different layouts, while doing file based routing please?

For example route /a uses layout ./src/lib/layouts/One.tsx and routes /b and /c use layout /Two.tsx I'd rather not just wrap the layout component in the route b/c then if we swap between pages that use the same layout state is lost Thanks!...

SSG / Partial Hydration

Hello all, I am doing SSG without SolidStart and it works for the most part, but I can't get on click to work on a button. My current flow is:...

Using solid-mdx in an SPA app (without solid-start/vinxi)

solid-mdxin verison 0.0.7 seems to be widely used as it's part of the solid-start mdx template, and also used for the solidjs and kobalte doc. Unfortunately it has no documentation. All these uses cases are for solid-start where the mdx is rendered on the server. My use case for MDX is to show help pages in an SPA page (it needs to stay SPA, there is no option for JS on the server). I have some trouble in this use case. In the solid-start template the "@vinxi/plugin-mdx" is used, which is not applicable for my application using vite directly. Older samples and the doc of the similar package solidjs-mdx seem to suggest to use @mdx-js/rollup instead. I had some success with follwing vite plugin config (but some issues as classNameinstead of classis passed in MDXProvider):...

Lazy loading components work with SSR with solidStart?

Hello all, i'm working on an e-commerce demo, and need to load a grid with data of the products, the problem is that the grid and the content, is based on admin preferences, so i want to load it with lazy loading. We will have like 5 or 6 very complex-different grids, so i don't want to LOAD ALL the options and use a switch or somethig because is just send JS to the client without optimizations. looks like "lazy" api is just for this. to load a component with dynamic import....

resource.error works unexpectedly

Consider this sample: https://playground.solidjs.com/anonymous/095fcbf7-6807-4c6b-ac41-223a5f2fde21 Per docs: data.error: if the request has errored out. createResource: provides an Error object for data.error. It will show even if the fetcher throws something else. If the fetcher throws a string, data.error.message will contain that string. I would expect the div with the error string be rendered to the dom but its not the case...

query function invalidates the cache every 10 clicks

I was wondering why the Suspense is triggered once in a while, then I realized query is not caching the result long enough. As you can see in this example, once every 10 click's the fetch function is hit again. The question is why query invalidates the cache basically rendering it useless. Here's the playground: https://playground.solidjs.com/anonymous/40fc1a3b-842a-4a02-8543-ebf113f9e1da...

Remote MDX on SolidStart

Inspired on the next.js code in https://mdxjs.com/guides/mdx-on-demand/, I've made my attempt of implementing on demand rendering with SolidStart: ```tsx // ~/components/MDXRenderer.tsx import { createSignal, Signal, createEffect } from "solid-js"...

Running BullMQ worker (background process) from a SolidStart project

I have a solidstart project with Redis as its backend. I'm trying to use BullMQ worker: sandboxed processor as the consumer. I'm trying to initialise it during server startup from entry-middleware.js as below: ```js import { createMiddleware } from "@solidjs/start/middleware"; import { authMiddleware } from "~/lib/auth/auth.middleware";...

reconcile within produce

Is it possible to use reconcile within the produce utility? ``` setState( produce(state => {...

SolidStart with Headless CMS content

Hello! I'm looking to port a small 11ty site over to SolidStart. I still want to fetch CMS content and generate some static pages once, at build time. I found this question (and answer): https://github.com/solidjs/solid-start/discussions/1548#discussion-6824754, which will let me achieve SSG with dynamic routes. But I do not understand where to carry out any data fetching. This question (https://github.com/solidjs/solid-start/discussions/920) asks the same thing; how to fetch data at build and not in the client?...

Slightly confused about the entry-client file

Hello, I've been trying to get into SolidStart. However, I'm kind of confused about the client entry file. Why does it not explicitly mention/import app.tsx/jsx? What is its responsibility? And how do I know what to put into app.tsx and what into the entry file?

What to do instead of loading a model with createMemo inside a createResource computation

``` /* solidjs view model */ function BookModel(id: string, name: string): BookModel { const [name, set_name] = createSignal('') const [chapters, set_chapters] = createSignal([])...

Error: Client-only API called on the server side

Hi, I want to add a router to my app and I did it as described on https://docs.solidjs.com/solid-start/building-your-application/routing#creating-new-routes. I'm getting this error: ``` Error: Client-only API called on the server side. Run client-only code in onMount, or conditionally...

How do you get createAsync to refetch or mutate?

I have a webpage where I get a list of items from a database. I want to take advantage of SolidStart's preloading and the other benefits of a createAsync based resource so I used it instead of createResource. Users can click a delete button next to each list item to delete it, and the list should update in response (possibly via an action). Now it occurs to me that the docs don't currently specify when, if or how createAsync based resources refetch data or if the data can be mutated (say by useS...

Version Mismatch?

```sh bun create solid --help (base) ┌
Create-Solid v0.6.1 A CLI for scaffolding new Solid projects (create-solid v0.6.1) 10:56:08 PM...

Component Duplication

Having initialized a new solid/vite project, I can confirm the component duplication issue is still happening (previously thought it was being triggered by tailwind/vite plugin). I have included a link to the bug report including screenshots and explanation of how I've been able to reproduce the issue. Any help in solving this would be greatly appreciated if anyone else has experienced and mitigated this. https://github.com/solidjs/vite-plugin-solid/issues/202#issue-2896396397...

Store update produces error "current is undefined"

I'm creating the example in the doc and getting the error ``` Uncaught TypeError: current is undefined updatePath dev.js:217...