nerotide
nerotide
SSolidJS
Created by nerotide on 6/28/2024 in #support
Redirect does not happen during load if there is an awaited call before it.
Umm I tried it like this but it seems like it is not working. It just logs the error into the console and the error boundary does not even get hit. I tried to wrap the entire app into an error boundary (in app.tsx) and it still had no effect.
import { Title } from "@solidjs/meta";
import { cache, RouteSectionProps } from "@solidjs/router";
import { ErrorBoundary } from "solid-js";

const getProject = cache(async function ({ id }: { id: string }) {
"use server";
throw new Error("Error");
}, "project");

export const route = {
load: (ctx: any) => getProject({ id: ctx.params?.id }),
};

export default function Editor(props: RouteSectionProps) {
return (
<main>
<Title>Editor</Title>
<ErrorBoundary fallback={() => <div>Error</div>}>
Editor page
</ErrorBoundary>
</main>
);
}
import { Title } from "@solidjs/meta";
import { cache, RouteSectionProps } from "@solidjs/router";
import { ErrorBoundary } from "solid-js";

const getProject = cache(async function ({ id }: { id: string }) {
"use server";
throw new Error("Error");
}, "project");

export const route = {
load: (ctx: any) => getProject({ id: ctx.params?.id }),
};

export default function Editor(props: RouteSectionProps) {
return (
<main>
<Title>Editor</Title>
<ErrorBoundary fallback={() => <div>Error</div>}>
Editor page
</ErrorBoundary>
</main>
);
}
5 replies
SSolidJS
Created by nerotide on 6/28/2024 in #support
Redirect does not happen during load if there is an awaited call before it.
Ahh sorry, forgot to mention... These are the versions of solid related packages that I am using. (currently the latest)
"@solidjs/meta": "^0.29.4",
"@solidjs/router": "^0.13.6",
"@solidjs/start": "^1.0.2",
"@solidjs/meta": "^0.29.4",
"@solidjs/router": "^0.13.6",
"@solidjs/start": "^1.0.2",
5 replies
SSolidJS
Created by nerotide on 12/26/2023 in #support
Dragging rectangles impossible? (tried to build a timeline component)
Wow thank you, that was simpler than I thought. I am now a little confused about when should I use signals. Are signals supposed to be used for primitive values like numbers, strings, and booleans and not things like arrays or objects? I mean like you always want your UI to react to any state changes and if signals can't do that, why should I use them?
7 replies