ibrahimyaacob
ibrahimyaacob4w ago

npx convex dev doesnt download generated code from another repo

i have 2 separate repo that i plan use to share convex backend. One is working fine, the new one (expo project), even after successfully running npx convex dev doesnt seems to load the functions correctly.
No description
No description
11 Replies
ibrahimyaacob
ibrahimyaacobOP4w ago
No description
ibrahimyaacob
ibrahimyaacobOP4w ago
i figured out something. it seems like running npx convex dev overrides the existing functions and schema created on the my main repo. i then run the same command on the main repo, and it regenerates the function (seen on convex dashboard). but the PROBLEM is, the 2nd repo doesnt receive the changes automatically and i need to run the command again on 2nd repo. and running it clears everything all over again
No description
ibrahimyaacob
ibrahimyaacobOP4w ago
please help
lee
lee4w ago
There should be a single source of truth for your convex functions, so one convex/ folder in one repo. If you want to call the convex functions from a different repo, you can use https://stack.convex.dev/multiple-repos
Convex in Multiple Repositories
Turns out, you can organize your Convex project across multiple repositories! Check out this guide on how to implement this in your project.
ibrahimyaacob
ibrahimyaacobOP4w ago
hey @Lee thanks for sharing this, trying this out right now okay it works! so i just need to keep runnning the CLI to update the generated api file but there's a problem, the generated data type returns any
ibrahimyaacob
ibrahimyaacobOP4w ago
No description
ibrahimyaacob
ibrahimyaacobOP4w ago
all of them returns any so im not getting total typesafety on the other repo oh i see this now
ibrahimyaacob
ibrahimyaacobOP4w ago
No description
ibrahimyaacob
ibrahimyaacobOP4w ago
so far so good then @Lee i do have a quick follow up question, i will try it myself later on, but will this work with convex auth ?
lee
lee4w ago
Yes it should work. If you see problems, let us know
ibrahimyaacob
ibrahimyaacobOP4w ago
Hey @lee ive tested it And it works Thank you !!

Did you find this page helpful?