Brendonovich
Brendonovich
Explore posts from servers
SSolidJS
Created by TaQuanMinhLong on 11/15/2024 in #support
Vite keeps loading the packages first before @solidjs/router
Assuming you're using pnpm run pnpm up -r @solidjs/router@latest
3 replies
SSolidJS
Created by TaQuanMinhLong on 11/15/2024 in #support
Vite keeps loading the packages first before @solidjs/router
This usually points to multiple versions of Solid Router being installed
3 replies
SSolidJS
Created by risk1996 on 11/11/2024 in #support
Fetch on SSR is missing Cookie on request header
const [res, { refetch }] = createResource(() => {
const event = getRequestEvent();
return fetch("http://localhost:3000/api/test", {
headers: event?.request.headers,
}).then((res) => res.json());
});
const [res, { refetch }] = createResource(() => {
const event = getRequestEvent();
return fetch("http://localhost:3000/api/test", {
headers: event?.request.headers,
}).then((res) => res.json());
});
8 replies
SSolidJS
Created by risk1996 on 11/11/2024 in #support
Fetch on SSR is missing Cookie on request header
Use getRequestEvent before the fetch to retrive the request headers, and then pass them into the fetch
8 replies
SSolidJS
Created by risk1996 on 11/11/2024 in #support
Fetch on SSR is missing Cookie on request header
With server functions this isn't a problem since there's no extra fetch on the server
8 replies
SSolidJS
Created by risk1996 on 11/11/2024 in #support
Fetch on SSR is missing Cookie on request header
When calling fetch on the server you'll need to manually pass through the request headers
8 replies
SSolidJS
Created by linker on 11/10/2024 in #support
Pre rendering
Yep, by customising server.prerender https://nitro.build/config#prerender
2 replies
SSolidJS
Created by Cyber Grandma on 11/5/2024 in #support
SolidStart layout shifts using createAsync
Yeah
31 replies
SSolidJS
Created by Cyber Grandma on 11/5/2024 in #support
SolidStart layout shifts using createAsync
Ye same thing different name
31 replies
SSolidJS
Created by Cyber Grandma on 11/5/2024 in #support
SolidStart layout shifts using createAsync
No? It's still gotta run the function - cache is per-request, not a global cache
31 replies
SSolidJS
Created by Cyber Grandma on 11/5/2024 in #support
SolidStart layout shifts using createAsync
So it navigates instantly and you see the suspense fallback
31 replies
SSolidJS
Created by Cyber Grandma on 11/5/2024 in #support
SolidStart layout shifts using createAsync
When you add the Suspense around main the data access is then caught by that brand new Suspense that doesn't have any previous UI to show, rather than an existing Suspense that can keep showing the route you're navigating from
31 replies
SSolidJS
Created by Cyber Grandma on 11/5/2024 in #support
SolidStart layout shifts using createAsync
Yeah it's entirely up to you, you can add and remove Suspense in different places to achieve different styles of loading states
31 replies
SSolidJS
Created by Cyber Grandma on 11/5/2024 in #support
SolidStart layout shifts using createAsync
The idea is that navigation happens inside a Transition, and since an existing Suspense somewhere higher up in your app is being triggered by accessing data, the Transition pauses the navigation until the Suspense resolves
31 replies
SSolidJS
Created by Cyber Grandma on 11/5/2024 in #support
SolidStart layout shifts using createAsync
Add a Suspense around main and the navigation from another page should be instant instead of waiting
31 replies
SSolidJS
Created by Cyber Grandma on 11/5/2024 in #support
SolidStart layout shifts using createAsync
Since it accesses data
31 replies
SSolidJS
Created by Cyber Grandma on 11/5/2024 in #support
SolidStart layout shifts using createAsync
If the Pagination component is calling pagination() then that's also a place that can suspend
31 replies
SSolidJS
Created by Cyber Grandma on 11/5/2024 in #support
SolidStart layout shifts using createAsync
I don't see one around Pagination so that might be it
31 replies
SSolidJS
Created by Cyber Grandma on 11/5/2024 in #support
SolidStart layout shifts using createAsync
Ah if you don't have a suspense then that might happen
31 replies
SSolidJS
Created by Cyber Grandma on 11/5/2024 in #support
SolidStart layout shifts using createAsync
I'd recommend keeping the Suspense
31 replies