So I’ve got a node compute module registered and working with manual testing
Manual Test
Email Receipt
However when I import to use it in my TS code repo It invokes but with the following error:
INFO
[2025-01-31T09:25:44.192119Z]
Job received - ID: b8fc4449-64ea-49f9-8e89-db01a865d6dd Query: sendEmail
INFO
[2025-01-31T09:25:44.192125Z]
No listener for query type: sendEmail
Code Repo usage
import { sendEmail as sendEmailFromComputeModule } from "@commsforge/computemodules";
export type EmailThread = {
messageId: string;
threadId: string;
labels?: string[];
}
...
export async function sendEmail(context: Context, event?: MachineEvent, task?: string): Promise<EmailThread> {
console.log('[EMAIL] Starting email send process...');
const emailData = parseEmailContext(context as unknown as ContextData);
if (!emailData) {
throw new Error('No email data found in context');
}
console.log('sending email via compute module:',
{
recipients: emailData.recipients,
subject: emailData.subject,
message: emailData.message
}
)
// BUG todo figure out why this is failing due to "No listener for query type: sendEmail"
const response: EmailThread = await sendEmailFromComputeModule({
recipients: emailData.recipients,
subject: emailData.subject,
message: emailData.message
});
console.log('[EMAIL] Constructed email thread response:', response);
return response;
}
I’ve gone through the docs docs/configuration/functions/using-compute-module-functions-in-ts
and have the following setting:
I’m not using a @Function decorator but not sure if that is the issue, or if its perhaps related to the input/output typing? If it was type mismatch I think i’d at least get to that failure point though?
Thanks in advance - let me know if there is something obvious I am missing regarding No listener for query type: sendEmail