Magnus Müller
Magnus Müller4mo ago

Vercel deployment works but 'Could not find public function for'

I want to make this live:. https://github.com/MagMueller/turbo-expo-nextjs-clerk-convex-monorepo I use Next.js and clerk. Vercel deployment runs through successfully, and I can access my page for 1 sec www.time-is-money.xyz , but then I get Application error: a client-side exception has occurred. And in convex deployment logs I get Could not find public function for 'users:getCurrentUser'. My tables don't get created. In development everything works fine. Because I use clerk, bought a custom domain, which I've linked in Vercel successfully. In convex project settings I get (for more than 2 hours): This domain is not verified yet. I added the api.time-is-money.xyzNot sure if this is correct. Because otherwise I think its conflicting with the dns of vercel, and without apiits also not working. Not sure where the error is or which key is wrong or is this an issue with authentication?
GitHub
GitHub - MagMueller/turbo-expo-nextjs-clerk-convex-monorepo: Monore...
Monorepo template with Turborepo, Next.js, Expo, Clerk, Convex - MagMueller/turbo-expo-nextjs-clerk-convex-monorepo
No description
No description
No description
No description
No description
No description
No description
No description
11 Replies
Convex Bot
Convex Bot4mo ago
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!
Magnus Müller
Magnus MüllerOP4mo ago
I believe the api.time-is-money.xyz - is not needed for me (i was confused by custome domains in convex). So i removed this also from dns. But the same Could not find public function forstill persists.
Magnus Müller
Magnus MüllerOP4mo ago
those are my Build & Development Settings - do i need to specify here where my convex functions are located? locally i just do npm run devand it works in my repo.
No description
Magnus Müller
Magnus MüllerOP4mo ago
I do export const getCurrentUser = query({ in packages/backend/convex/users.ts
sshader
sshader4mo ago
It sounds like somehow you're either not deploying your Convex functions as part of the build, or your frontend is talking to the wrong Convex deployment. What do the logs for your Vercel build look like? Usually there's a line like Deploying to https://happy-animal-123.convex.cloud -- make sure that matches up with the deployment you're connecting to from the frontend (you can check this by looking in the network tab for requests to .convex.cloud, or alternatively, sounds like you could check that the deployment where you're seeing these errors matches up)
Magnus Müller
Magnus MüllerOP4mo ago
✔ Ran "npm run build" with environment variable "NEXT_PUBLIC_CONVEX_URL" set
- Deploying to https://determined-stingray-978.convex.cloud...
✔ Deployed Convex functions to https://determined-stingray-978.convex.cloud
✔ Ran "npm run build" with environment variable "NEXT_PUBLIC_CONVEX_URL" set
- Deploying to https://determined-stingray-978.convex.cloud...
✔ Deployed Convex functions to https://determined-stingray-978.convex.cloud
and Deployment URL in convex https://determined-stingray-978.convex.cloud
sshader
sshader4mo ago
Do the functions show up in the Convex dashboard (under the functions tab)?
Magnus Müller
Magnus MüllerOP4mo ago
i dont see my funcitons and tables in the convex dashboard in production (in dev they are)
sshader
sshader4mo ago
Also just noticed this is a turborepo set up -- you probably want to be running npx convex deploy from the packages/backend directory (I'm less familiar with turborepo, but let me see if I can find some threads)
Magnus Müller
Magnus MüllerOP4mo ago
do i need to add sth here npx convex deploy --cmd 'npm run build It works! build command in vercel: npm run vercel-build Root Directory: apps/web In apps/web/package.json add vercel-build in the key scripts So
` "scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"vercel-build": "cd ../../packages/backend && npx convex deploy && cd ../../apps/web && npm run build"
},
` "scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"vercel-build": "cd ../../packages/backend && npx convex deploy && cd ../../apps/web && npm run build"
},
Magnus Müller
Magnus MüllerOP4mo ago
It is a fork from this repo template https://www.convex.dev/templates/open-source-todoist-clone maybe can be added.
An Open Source AI-Powered Todoist Clone
Todovex is an Open Source AI-Powered Todoist Clone Built with the Next.js 14 App Router, Convex, React, Next.js Auth V5 i.e. Auth.js, Google Sign in, ShadCN UI library, React Hook Forms, TypeScript, OPenAI, TailwindCSS and more. 🌐 Next.js & Server actions 🤖 AI Suggest Missing Tasks and Sub-Tasks using Open AI 🎨 Beautiful components using Shadcn...

Did you find this page helpful?