Ciantic
Ciantic
Explore posts from servers
SSolidJS
Created by Ciantic on 10/22/2024 in #support
H3Error: Cannot find module 'bun:sqlite' imported from
The vinxi/nitro thingamabob starts some node processes, and this somehow shims them to start bun processes, or something like that.
4 replies
SSolidJS
Created by Ciantic on 10/22/2024 in #support
H3Error: Cannot find module 'bun:sqlite' imported from
Actually! It was easier to fix than I thought:
bun --bun run dev
bun --bun run dev
4 replies
SSolidJS
Created by Ciantic on 10/22/2024 in #support
H3Error: Cannot find module 'bun:sqlite' imported from
I think this is a quite difficult to fix: https://github.com/oven-sh/bun/issues/6738
4 replies
SSolidJS
Created by Ciantic on 10/20/2024 in #support
How to get 'client side' createResource behavior in SolidStart?
If I remove it, SolidStart freaks out
76 replies
SSolidJS
Created by Ciantic on 10/20/2024 in #support
How to get 'client side' createResource behavior in SolidStart?
it has already Suspense
76 replies
SSolidJS
Created by Ciantic on 10/20/2024 in #support
How to get 'client side' createResource behavior in SolidStart?
that is solidstart's app.tsx
76 replies
SSolidJS
Created by Ciantic on 10/20/2024 in #support
How to get 'client side' createResource behavior in SolidStart?
import { MetaProvider, Title } from "@solidjs/meta";
import { Router } from "@solidjs/router";
import { FileRoutes } from "@solidjs/start/router";
import { Suspense } from "solid-js";
import "./app.css";

export default function App() {
return (
<Router
root={props => (
<MetaProvider>
<Title>SolidStart - Basic</Title>
<a href="/">Index</a>
<a href="/about">About</a>
<Suspense>{props.children}</Suspense>
</MetaProvider>
)}
>
<FileRoutes />
</Router>
);
}
import { MetaProvider, Title } from "@solidjs/meta";
import { Router } from "@solidjs/router";
import { FileRoutes } from "@solidjs/start/router";
import { Suspense } from "solid-js";
import "./app.css";

export default function App() {
return (
<Router
root={props => (
<MetaProvider>
<Title>SolidStart - Basic</Title>
<a href="/">Index</a>
<a href="/about">About</a>
<Suspense>{props.children}</Suspense>
</MetaProvider>
)}
>
<FileRoutes />
</Router>
);
}
76 replies
SSolidJS
Created by Ciantic on 10/20/2024 in #support
How to get 'client side' createResource behavior in SolidStart?
and I see, the original app.tsx has suspense
76 replies
SSolidJS
Created by Ciantic on 10/20/2024 in #support
How to get 'client side' createResource behavior in SolidStart?
When I use the original code inside TestFetch
76 replies
SSolidJS
Created by Ciantic on 10/20/2024 in #support
How to get 'client side' createResource behavior in SolidStart?
import { MetaProvider, Title } from "@solidjs/meta";
import { Router } from "@solidjs/router";
import { FileRoutes } from "@solidjs/start/router";
import { Suspense } from "solid-js";
import "./app.css";
import { TestFetch } from "./components/TestFetch";

export default function App() {
return <TestFetch />;
}
import { MetaProvider, Title } from "@solidjs/meta";
import { Router } from "@solidjs/router";
import { FileRoutes } from "@solidjs/start/router";
import { Suspense } from "solid-js";
import "./app.css";
import { TestFetch } from "./components/TestFetch";

export default function App() {
return <TestFetch />;
}
76 replies
SSolidJS
Created by Ciantic on 10/20/2024 in #support
How to get 'client side' createResource behavior in SolidStart?
hey! it works in app.tsx
76 replies
SSolidJS
Created by Ciantic on 10/20/2024 in #support
How to get 'client side' createResource behavior in SolidStart?
inside router or startserver there is suspense?
76 replies
SSolidJS
Created by Ciantic on 10/20/2024 in #support
How to get 'client side' createResource behavior in SolidStart?
I don't think I did
76 replies
SSolidJS
Created by Ciantic on 10/20/2024 in #support
How to get 'client side' createResource behavior in SolidStart?
solidstart handles suspends somehow differently from regular old solidjs
76 replies
SSolidJS
Created by Ciantic on 10/20/2024 in #support
How to get 'client side' createResource behavior in SolidStart?
Thanks @Brendonovich I now have to think how all of this works
76 replies
SSolidJS
Created by Ciantic on 10/20/2024 in #support
How to get 'client side' createResource behavior in SolidStart?
<Match when={user.latest}>
<div>{JSON.stringify(user.latest)}</div>
</Match>
<Match when={user.latest}>
<div>{JSON.stringify(user.latest)}</div>
</Match>
76 replies
SSolidJS
Created by Ciantic on 10/20/2024 in #support
How to get 'client side' createResource behavior in SolidStart?
Okay! It works with initialValue and user.latest hack
76 replies
SSolidJS
Created by Ciantic on 10/20/2024 in #support
How to get 'client side' createResource behavior in SolidStart?
I forgot user.latest
76 replies
SSolidJS
Created by Ciantic on 10/20/2024 in #support
How to get 'client side' createResource behavior in SolidStart?
import {
createSignal,
createResource,
Switch,
Match,
Show,
Suspense,
startTransition,
createEffect,
} from "solid-js";

const fetchUser = async (id: any) => {
await new Promise((resolve) => setTimeout(resolve, 2000));
const response = await fetch(`https://swapi.dev/api/people/${id}/`);
return response.json();
};

export function TestFetch() {
const [userId, setUserId] = createSignal();
const [user] = createResource(userId, fetchUser, {
initialValue: 1,
});

return (
<div>
<input
type="number"
min="1"
placeholder="Enter Numeric Id"
onInput={(e) => setUserId(e.currentTarget.value)}
/>
<Show when={user.loading}>
<p>I'm LOADING!...</p>
</Show>
<Switch>
<Match when={user.error}>
<span>Error: {user.error}</span>
</Match>
<Match when={user()}>
<div>{JSON.stringify(user())}</div>
</Match>
</Switch>
</div>
);
}
import {
createSignal,
createResource,
Switch,
Match,
Show,
Suspense,
startTransition,
createEffect,
} from "solid-js";

const fetchUser = async (id: any) => {
await new Promise((resolve) => setTimeout(resolve, 2000));
const response = await fetch(`https://swapi.dev/api/people/${id}/`);
return response.json();
};

export function TestFetch() {
const [userId, setUserId] = createSignal();
const [user] = createResource(userId, fetchUser, {
initialValue: 1,
});

return (
<div>
<input
type="number"
min="1"
placeholder="Enter Numeric Id"
onInput={(e) => setUserId(e.currentTarget.value)}
/>
<Show when={user.loading}>
<p>I'm LOADING!...</p>
</Show>
<Switch>
<Match when={user.error}>
<span>Error: {user.error}</span>
</Match>
<Match when={user()}>
<div>{JSON.stringify(user())}</div>
</Match>
</Switch>
</div>
);
}
76 replies
SSolidJS
Created by Ciantic on 10/20/2024 in #support
How to get 'client side' createResource behavior in SolidStart?
I provided initialValue but it still blinks
76 replies