Razboy20
Razboy20
SSolidJS
Created by Razboy20 on 10/31/2023 in #support
TypeError: Cannot read properties of null (reading 'push')
I'm a bit clueless about what is causing this, except the project produces this error in the client bundle when built, but not in development. https://e264c050.ticket-counter.pages.dev/
5 replies
SSolidJS
Created by Razboy20 on 2/7/2023 in #support
CSS Transition does not get animated properly when applied in style={} directly
8 replies
SSolidJS
Created by Razboy20 on 1/15/2023 in #support
Generate random numbers serverside and don't regenerate on hydration
I'm trying to generate a list of random numbers for a skeleton loader, and I've found a solution, but it does not feel like the right way to do this.
const [randomsResource] = createResource(() => [""], {
initialValue: [
"3".repeat(5 + Math.floor(Math.random() * 6)),
"a".repeat(7 + Math.floor(Math.random() * 20)),
"a".repeat(15 + Math.floor(Math.random() * 10)),
"a".repeat(15 + Math.floor(Math.random() * 10)),
"a".repeat(15 + Math.floor(Math.random() * 10)),
],
ssrLoadFrom: "initial",
});
const randoms = randomsResource();

return <div>{randoms[0]</div> ...
const [randomsResource] = createResource(() => [""], {
initialValue: [
"3".repeat(5 + Math.floor(Math.random() * 6)),
"a".repeat(7 + Math.floor(Math.random() * 20)),
"a".repeat(15 + Math.floor(Math.random() * 10)),
"a".repeat(15 + Math.floor(Math.random() * 10)),
"a".repeat(15 + Math.floor(Math.random() * 10)),
],
ssrLoadFrom: "initial",
});
const randoms = randomsResource();

return <div>{randoms[0]</div> ...
Is there a better method to only execute something server-side, and send that to the client?
3 replies
SSolidJS
Created by Razboy20 on 1/13/2023 in #support
Vercel + Prisma
90 replies
SSolidJS
Created by Razboy20 on 1/10/2023 in #support
Math.random() overwritten on hydration
I have a skeleton component which I want to have a slight randomness to its width, so I have
<span class="skeleton-text text-clip whitespace-nowrap">{"a".repeat(7 + Math.floor(Math.random() * 20))}</span>
<span class="skeleton-text text-clip whitespace-nowrap">{"a".repeat(7 + Math.floor(Math.random() * 20))}</span>
However, on hydration, the inner text of the span is removed. I have 2 questions: 1) Why, instead of re-rendering with different randomness, does it just disappear? 2) Can I stop hydration of this skeleton component to only use the ssr sent inner text? - Raz pepesaber
4 replies
SSolidJS
Created by Razboy20 on 12/14/2022 in #support
Vite v4 breaking solid-auth
Updating vite to 4.0.0 is causing problems where "uuid" is failing to load for some reason. I have no clue why, and was wondering whether anyone here may have any ideas. To replicate, I used create-jd-app with solid-auth, then updated packages. When attempting to login, this error is produced: Error: Cannot read properties of undefined (reading 'v4')-coming from attempting to import { v4 } from "uuid". Vite 3 does not cause this issue.
9 replies