SolidJS

S

SolidJS

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

Join

Build Error: " No known conditions for "./routes" specifier in "vinxi" package"

The dev server runs without any issues. However, running vinxi build is causing the above error. I'm just not even sure where to begin to start debugging this......

Error when using "createResource" as global.

So, look at the image. On it you see that the Resource is global scoped. But i got the error "Cannot use 'in' operator to search for 'data' in undefined", it's a bug? How i can fix this "bug", because when i do many same resources, it's fetches all of them, and so big load on server... I tried some things, like using the "createRoot", or "resource.latest", it's not working. I don't know english so good, because i am living in country, with different language 🙂....
No description

LocalStorage Hydration Mismatch

I'm trying to display a component that should display the city name after retrieving it from localstorage, but i get this error Error: Hydration Mismatch. Unable to find DOM nodes for hydration key I use @solid-primitives/storage to keep the result of the API call in local storage and a Context to access it anywhere in my application. ...
No description

Firefox - PROD - CORS Missing Allow Origin

Hi everybody, I have a webapp that uses solid start. Everything works fine with Brave browser, but testing it with Firefox every fetch request fails because of "CORS Missing Allow Origin". (Only on production environment, in development it works fine with every browser) I searched a bit here on discord and on google....

Cast from `Type | undefined`

Hi everyone. I'm trying to show a data from Sanity CMS, using createAsync: ```ts const data = createAsync(() => getProject(params.slug));...

Setting Cookies in API Route with `aws-lambda-streaming` nitro preset.

When trying to set a cookie in a SolidStart api route using vinxi/setCookie - nothing is being set. I'm just trying to figure out if this is a me issue or a possible nitro bug with the lambda streaming preset? Code is below - in the callback api route when I try to access the cookie using vinxi/getCookie I get 'undefined'. ```javascript import { sendRedirect, setCookie, getCookie } from "vinxi/http"; import { generateState } from "arctic";...

Navigating through @solidjs/router doesn't load global app.css

When navigating from index to another route, the app.css doesn't persist as a <style> tag, despite being imported in the app.tsx file. Demo project: https://github.com/zimonitrome/solid_error_demo.git To reproduce: npm install, npm run dev, click "page 2" -> "home" -> "page 2" from the navigation links. ...
No description

createResource signal isn't trigger if undefined or null

``` let fetcher: Signal<number | undefined> = createSignal(3) let r = createResource(fetcher, async (v) => console.log(v)) ...

is it necessary to mark "use server" for useSession

"use server" means executing only on the server. So, is it necessary to mark "use server" for useSession of h3? If marked, is there a risk of execution order issues? In the example (with-auth), I did not see the "use server" marker. However, in one of my experimental projects, if I don’t add "use server", the build fails. After adding "use server" and successfully building, every time I refresh the page, the previously initialized h3 session with data gets cleared. I suspect that use server is causing a delay in the execution time of useSession. Here is the code where I use useSession:...

set signal batched intermediate sets are lost for animation

``` createEffect(() => console.log(count())) set_count(undefined)...

Untrack has no effect but signal doesn't fire anyway

Take a look at this way of events: ``` createEffect(() => { console.log('fix fix', this.roundn0)...

Using vitest to render FileRoutes?

Hey guys, I'm trying to run tests rendering the routes using the whole app with vitest. But I'm getting import errors inside the solid/routes package when I try. I've got a more exhaustive GitHub discussion here https://github.com/solidjs/solid-start/discussions/1583 with stack blitz and all to reproduce. Is it possible to do this or do I have to change some default configurations?

"default" is not exported by "src/entry-client.tsx"

Hi everybody, I've noticed the following warning during build time in my project. I tried to create a new project from scratch with > solid start > typescript > tailwindcss, and I was that this warning still persists. ...

Using createEffect to denormalise for efficiency - good/bad idea?

My question is related to this advice, from the docs:
Effects are meant primarily for side effects that read but don't write to the reactive system: it's best to avoid setting signals in effects, which without care can cause additional rendering or even infinite effect loops. Instead, prefer using createMemo to compute new values that depend on other reactive values, so the reactive system knows what depends on what, and can optimize accordingly.
Say I'm building a spreadsheet like app. There could be many thousands of cells. One can be selected. Let's say each has an ID and there's a central store that has selectedCellID. Each cell can have:...

How do get Cloudflare bindings in dev?

I am struggling to access my Cloudflare bindings in devleopment using Solid Start. I created the project using create-cloudflare. ``` import { getRequestEvent } from "solid-js/web"; ...

Redirecting on protected routes

Hey! Is there any recommended way to do route protecting on the server with SSR? For example, I need to redirect users from protected routes to the previous URL, if exists on router. Here's my current implementation:...

Error : Hydration Mismatch

Im using SolidStart first time . I chose the basic template . Created the project using command yarn create solid . Iam trying to add a new page 'cart.tsx' but it shows following error . I have not modified any config files , just ran the dev server and created a new file .
No description

Section that only render for specific paths

Hi everyone I'm trying to create a CTA section that renders on every page execpt two specific path names. This is my code: ````tsx...

context provider's values are not being updating after useContext gets user session info.

I am trying to use a context provider to be able to easily call my users data from any of the pages/routes. Originally, when I would try to read the data from my useAuth.user it would return "undefined" which lead me to adding a default value in AuthContextData. Now it inly shows the default data and it does not update the user or isLoading. I do not know what I am doing wrong, ```const defaultAuthContextValue: AuthContextData = { user: () => { return null; },...
No description