Type inference issue with newly added routes
All my previous routes work fine and are correctly typed. All of a sudden, things stopped. When I add a new function, type inference from react stpped working as expected.
I placed the new function in an old
queries.ts
file that is properly typed, only the new function has this inference. Any idea what causes this?3 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!
More info: Turbo Monorepo
convex exists in another directory named
api
, imported with type alias @api/
hnotes imports @api
.. exisiting apis imported from api
are type correctly but new functions are not typed correctlytroubleshooting:
- is
npx convex dev
running? it needs to update things in the _generated
folder when there are new files
- try restarting typescript in your editor
- make sure the queries are defined and exported like export const myquery = query(...)