Unable to execute internal action from dashboard or CLI
I've got an internal action which I use to invite users to my application. It accepts some parameters (
emailAddress
and userRole
) and coordinates with Clerk to send an invitation email and add the user to the DB with the correct role. It was intended to be run exclusively from the dashboard (or the CLI via convex run
, though the dashboard is generally much easier). However, I'm running into some odd issues attempting to execute it by either method. See attached screen recording for what happens when I try to execute it via the dashboard. When I try to execute it via the CLI, I'm getting a validation error that I'm not sure I believe (scrubbed of some irrelevant data/PII):
7 Replies
Does making this a named function change anything? I'm imagining default exports are less well tested
man I wish our validators were pretty-printed in errors!
That seems to work!
The dashboard, or from the CLI?
FYI, I do know this has worked in the past as a default export
From the dashboard
For the dashboard, I'd venture a guess that we're not handling well that you have a file called
inviteUser
(with a default export) as well as a directory called inviteUser
Also now works from the CLI!
This is a pattern I've been trying out sometimes, for things like scripts—having a single file entrypoint with a default export, and then supporting Convex functions (and in theory other code) in a directory of the same name (i.e. in that entrypoint function's namespace)
Yeah I don't know a reason why that pattern wouldn't work in general, but I'd guess we have a dashboard bug here (and maybe a
npx convex run
bug too, who knows). Will investigate.