#Typing Issues
1 messages · Page 1 of 1 (latest)
You're encountering a TypeScript error because the internal API object doesn't recognize the descriptions property in your path. This is a common issue when working with Convex's internal function references.
The Problem
The error occurs because TypeScript can't find the descriptions module in your internal API structure. This typically happens when:
- The function you're trying to reference (
fetchAndUpdateDescriptionsFromExternalApi) is defined in the current file but not properly exported as an internal function - The generated API types haven't been updated to include your new function
Solution
Since you're defining fetchAndUpdateDescriptionsFromExternalApi as an internalAction in the same file where you're trying to reference it, you need to make sure Convex has generated the proper type definitions.
Here are the steps to fix this issue:
-
Make sure you're running
npx convex devThis command keeps your generated types up to date. If you haven't been running it, start it now.
-
Check for circular type inference
Your error might be related to a circular type inference issue that can happen with actions. As mentioned in the Convex documentation on dealing with circular type inference, you might need to explicitly type your function return.
-
Try explicitly typing your action's return value:
export const fetchAndUpdateDescriptionsFromExternalApi = internalAction({ args: { // your args }, handler: async (ctx, args): Promise<string> => { // your implementation }, }); -
Ensure all your files are properly imported
Make sure there are no import errors in your project that might prevent proper type generation.
-
Check your folder structure
Ensure your folder structure matches what you're trying to reference. The path
internal.customActions.internal.AI.descriptionsshould match your actual file structure.
If you're still having issues after trying these steps, you might need to use a workaround as described in the TypeScript documentation by explicitly typing the result of your function calls.