#Cannot find module 'convex/types' or its corresponding type declarations.
3 messages · Page 1 of 1 (latest)
Hi @brisk terrace. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
It looks like you're encountering a TypeScript error related to missing type declarations for Convex. This is a common issue that can occur when working with TypeScript in a Convex project.
There are a few potential solutions to this problem:
-
Make sure you're using a compatible TypeScript version. Convex requires TypeScript version 5.0.3 or newer as mentioned in the TypeScript documentation.
-
Run code generation. Convex uses code generation to create types specific to your app. Try running:
npx convex devThis will generate the necessary type definitions in the
convex/_generateddirectory as documented here. -
Check your tsconfig.json. Some users have reported issues with the
moduleResolutionsetting. Try settingcompilerOptions.moduleResolutionto "Bundler" in your convex/tsconfig.json as suggested in community discussions. -
Check for path mapping issues. If you're using custom path mappings in your tsconfig.json (like
"paths": {"@/*": ["./*"]}), this might be causing conflicts with Convex's type resolution as reported by community members.
If you're still experiencing issues after trying these solutions, you might want to check if your project structure is correct or if there are any specific configurations in your setup that could be causing the problem.