Issue scheduling an internal action from a helper function
I'm using Convex version 1.26.1. In one file I have an internal action defined like this:
In a different file, I have a helper function where I'm passing
ctx
(typed as GenericActionCtx<any>
). In that function I'm trying to schedule the above action like this:
The internal.it.internalEmail.sendInternalEmail
function reference is underlined, and hovering displays this error:
I can't see any error in this setup. Any idea why it's claiming that there's a type mismatch?
For reference, here's what the kapa.ai bot said about this. Aside from the things it mentioned that were clearly not issues (e.g. passing an object instead of a function reference), I did try using ActionCtx
instead of GenericActionCtx<any>
, but the error was the same.7 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
Pass your
DataModel
to GenericActionCtx
instead of any
Hmm
although GenericActionCtx<any>
would still have schedulerYeah, it's not saying that the
scheduler
part is the issue. It's complaining about the internal action passed.yeah, it's saying it's an object with a key for the function
you sure the file isn't named sendInternalEmail?
Doh!
That's it. I hadn't completed the reference to point to the function. It was pointed to the file.
Very tempted to rename one of the two 😂
hahaha
or just make the function the default export
and rename the file index.ts nope not that lol
True. I don't think that I'll have any other exports from that file