Van De Mog
Van De Mog5mo ago

_generated exports 2 api imports

I looks like my TS is recognizing 2 available api's for the project that I'm working on, however none of them seems to work. Already cleaned and re-generated the folders, as well as restarts for the next server and convex. Can't seem to find a solution here, neither nothing already on this.
No description
No description
No description
2 Replies
sshader
sshader5mo ago
I'm not sure about why there are two entries showing up in the auto complete, but the "Module not found" error is often because you have something like baseUrl: "." in a tsconfig.json, but your bundler is not actually set up to resolve all imports relative to that path. So TypeScript believes that an import like "convex/_generated/api" is fine (and will be resolved to something like your-app/convex/_generated/api), but your bundler only knows how to resolve a relative import (something like ../convex/_generated/api) or to resolve it within node modules (from the error message, looks like it's trying to look for _generated/api in the convex node module) I'd try switching to relative imports (e.g. ../convex/_generated/api) and see if those work
Van De Mog
Van De MogOP5mo ago
+1 Solution was to fix my paths Thanks!

Did you find this page helpful?