S
SolidJS11mo ago
bakunawa

Cached resource runs into an error when using an action

I'm running into this error which I've isolated to a component that uses this cached function
const getAgentsAction = cache(async () => {
try {
const agents = await listAgents();
return agents;
} catch (error) {
throw error;
}
}, "agents");
const getAgentsAction = cache(async () => {
try {
const agents = await listAgents();
return agents;
} catch (error) {
throw error;
}
}, "agents");
Whenever I run this action, I get the error in the screenshot
const createEntityAction = action(async (data: any) => {
console.log({ data });
try {
const agent = await addAgent(data);
} catch (error) {
throw error;
}
});

const createEntity = useAction(createEntityAction);
const createEntityAction = action(async (data: any) => {
console.log({ data });
try {
const agent = await addAgent(data);
} catch (error) {
throw error;
}
});

const createEntity = useAction(createEntityAction);
No description
2 Replies
lxsmnsyc
lxsmnsyc11mo ago
seems to be a dev-related error? or maybe it's related to one of your mutation
bakunawa
bakunawaOP11mo ago
yeah it's definitely caused by the mutation action. thing is even if I comment out the server function and just log something, same error occurs
const createEntityAction = action(async (data: any) => {
console.log({ data });
// try {
// const agent = await addAgent(data);
// } catch (error) {
// throw error;
// }
});
const createEntityAction = action(async (data: any) => {
console.log({ data });
// try {
// const agent = await addAgent(data);
// } catch (error) {
// throw error;
// }
});
might actually have something to do with the component library I'm using hmm.
Want results from more Discord servers?
Add your server