Vincent Udén
Vincent Udén
Explore posts from servers
SSolidJS
Created by Vincent Udén on 11/9/2023 in #support
`unstable_clientOnly` doesn't solve SSR issues when importing a dependency
I'm running SolidStart and have had some issues throughout with certain deps that do not play well on the server side. Usually this has been resolved using unstable_clientOnly to ignore the dependency on the server side. This time it's not working though. This works fine in my component using npm run dev, but not using npm run build.
const HexColorPicker = unstable_clientOnly(async () => (await import("solid-colorful")).HexColorPicker);
const HexColorPicker = unstable_clientOnly(async () => (await import("solid-colorful")).HexColorPicker);
I have tried
export default defineConfig({
plugins: [solid({ adapter: vercel({ edge: false })})],
optimizeDeps: {
include: [],
exclude: ["solid-colorful"],
},
ssr: {
noExternal: ["solid-colorful"],
},
});
export default defineConfig({
plugins: [solid({ adapter: vercel({ edge: false })})],
optimizeDeps: {
include: [],
exclude: ["solid-colorful"],
},
ssr: {
noExternal: ["solid-colorful"],
},
});
to no success. The component itself is also wrapped in a unstable_clientOnly so it's content shouldn't even be loaded on the server at all. I can't fathom why npm run build is even trying to go over the file at all. ANY help or pointers would be much appreciated as I have been struggling for hours at this point
2 replies
SSolidJS
Created by Vincent Udén on 8/28/2023 in #support
No Vercel Logs
Hi! I've deployed a solid-start app using Auth.js which I originally generated using create-jd-app to vercel. Trouble is my serverless functions are not working at all /api/auth/session just produces
A server error has occurred

FUNCTION_INVOCATION_FAILED
A server error has occurred

FUNCTION_INVOCATION_FAILED
My reading has led me to believe that the next step is to look at vercel logs, but I'm not getting any runtime logs. Has anyone bumped into anything similar? I'm really out of ideas here.
3 replies
SSolidJS
Created by Vincent Udén on 7/6/2023 in #support
createResource refetch causes full page refresh
I'm using SolidStart, dabbling for the first time with data fetching using Solid, apologies in advance for any simple misunderstandings. I've got an API route giving me a list of projects which I've put into a resource in the following manner:
/* ... */
const [projects, { refetch: refetchProjects }] = createResource(getProjects);
/* ... */
/* ... */
const [projects, { refetch: refetchProjects }] = createResource(getProjects);
/* ... */
The fetching function itself is as follows
async function getProjects() {
const response = await fetch("/api/projects", { method: "GET" });
if (response.ok) {
return response.json();
} else {
return [];
}
}
async function getProjects() {
const response = await fetch("/api/projects", { method: "GET" });
if (response.ok) {
return response.json();
} else {
return [];
}
}
When manually triggering refetchProjects() in an onClick the entire page flashes white in what seems like a full page reload. Any ideas as to what I'm doing wrong? Are resources the wrong solution?
9 replies