Axolotl
Axolotl
Explore posts from servers
SSolidJS
Created by Axolotl on 6/6/2024 in #support
Can I make a library package in solid-start
Hi, how can I create a library package in solid-start, like svelte-kit has package option while setup. is there any option like that in solid-start or any other ways? if I build in solid-start it outputs .vinxi and .output instead of dist. I'm really stuck now, any help is appreciated :) ps: I created using solid-lib-starter, but I wonder if theres any way with solid-start itself. thank you.
1 replies
SSolidJS
Created by Axolotl on 5/29/2024 in #support
FIXED: fetch error on route load function
const getUser = cache(async (username: string) => {
const data = await fetch(ApiEndpoints.user.auth.WHO_AM_I, {
credentials: "include",
});
console.log(data);
return data;
}, "user");

export const route = {
load: (args) => {
const username = get_username(args.params.user);
console.debug(username);
getUser(username);
},
matchFilters: {
user: (v: string) => v.length > 1 && v.includes("@")
}
} satisfies RouteDefinition;
const getUser = cache(async (username: string) => {
const data = await fetch(ApiEndpoints.user.auth.WHO_AM_I, {
credentials: "include",
});
console.log(data);
return data;
}, "user");

export const route = {
load: (args) => {
const username = get_username(args.params.user);
console.debug(username);
getUser(username);
},
matchFilters: {
user: (v: string) => v.length > 1 && v.includes("@")
}
} satisfies RouteDefinition;
calling getUser function inside load function is causing fetch error. but this same endpoint(ApiEndpoints.user.auth.WHO_AM_I) works outside this load function, so I dont think its server error. also it prefetch data on link hover, so server works, I dont get whats the issue inside function.
11 replies