Cannot find module 'convex/_generated/api'
Out of nowhere I started getting this type check error when running
npx convex dev. The only file reporting this supposed error is a custom hook, and the import line looks like this:
import { api } from "convex/_generated/api";
This same import syntax is used in a couple dozen other files with no problem: custom hooks, components, etc. The actual behavior of the custom hook is fine. No problems using the queries it contains.
I've updated to the latest version of Convex, and still get this type check error. I've checked a couple of other threads here reporting similar problems, but can't find a solution that'll work.
I'm mostly ignoring it for now, but it would be nice to know why it's claiming there's a problem when there isn't. 🤷♂️4 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!
Forget what I said about the Convex update. Long story short, that started a chain of tons of things breaking that I don't know how to fix, so I reverted back to the version I was using before (1.16.0). Now it's just the type check warning again.
Never mind. I eliminated the problem by eliminating the use of that hook. I moved the query into the one component that still needed it after some refactoring, and there's no type check warning there. 🤷♂️
I get this in every file that imports from _generated. I have a monorepo and haven't managed to find a fix.
Cannot find module '@repo/db/convex/_generated/api' or its corresponding type declarations.
That's a different error from what I was getting. Please start a new thread about it (if you haven't already done so).