Cannot solve "Convex functions should not directly call other Convex functions"
I searched, asked AI and tried to create helper functions but I can't get rid of this warn, it seems to be happening in my
Promise.all()
because I get a lot of logs.
My helper functions:
Rest of code is in the next comment because of Discord limit.24 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!
hmm i don't see anything wrong in this code. can you share the code for
import { geospatial } from "@/convex";
?it's a component, here https://github.com/get-convex/geospatial
GitHub
GitHub - get-convex/geospatial: Convex component for geospatial ind...
Convex component for geospatial indexing. Contribute to get-convex/geospatial development by creating an account on GitHub.
makes sense. and the code is
export const geospatial = new GeospatialIndex(...)
or something?yes, here
What version of that component are you using?
"@convex-dev/geospatial": "^0.1.7",
since it's still in beta, could be a minor issue from the lib?could be, but i don't see an issue with the lib though. is this happening in prod or convex-test?
oh i see you're calling
internal.routes.insertGeospatialPoint
but according to your filepaths it would be internal.index.insertGeospatialPoint
. can you share the contents of convex/routes.ts
?updated the code to use my helper function but there's no
internal.routes
, with internal
it seems I can access any internalMutation
, internalAction
or internalQuery
You have code that calls internal.routes.insertGeospatialPointMutation, that's a function presumably defined in convex/routes.ts? that's code we can't see and we're wondering if has this pattern in it
my bad,
routes
is the current file and it's also a table in my db
this is routes.ts
Did the "Convex functions should not directly call other Convex functions" error have any other details?
to make sure we're on the same page, what we're trying to do is fine where a convex query, mutation, or action is being called directly instead of using helper functions
so just looking at the code could be enough, if we can find the right code to look at
also, these warns only happens on my local terminal (when running
npx convex dev
), there are no warns in my project logsno more details from logs

Oh isn't it just this?
oh that's what Lee asked abotu alreacyx
hmm this is the helper function
can you show that code?
am I doing it wrong?
here
I was trying to follow this https://docs.convex.dev/understanding/best-practices/#use-helper-functions-to-write-shared-code
Best Practices | Convex Developer Hub
This is a list of best practices and common anti-patterns around using Convex.
huh yeah it looks ok, it's not a Convex Function, it's a helper
seems like any interaction with geospatial will log this warning, so if you're saying the code looks ok I could just ignore it for now
Sounds good
Looks like this is the issue https://github.com/get-convex/geospatial/blob/b2dcb6a4c0cdf8ccfc8822a96694a5369d2ff6c7/src/component/document.ts#L49
in the geospatial component
thanks for reporting @vini, we'll let you know when there's a new version of the geospatial component that fixes this
thanks for helping and sure I'm looking to further use it so I'll be checking any updates 😁