hey all, can someone help deploy my
hey all, can someone help deploy my convex site to vercel please
getting this error but I do the command as per convex docs for the build


82 Replies
https://github.com/genxai/new
my project is open source here
you somehow don't have a _generated Folder, you need to run the command
npx convex dev
and once your API is generated you should run the npm build command locally, and fix the errors in your repo.
and I'd generally not import the api like that, I'd create a path resolver in my tsconfig to reolve the path for exampleso do I run this locally
npx convex dev
then commit the generated files?
mby it should be done at build phase?
somewhere here perhaps
yep, commit the generated files
when you commit whatever code uses it
ok lovely, comitting
that's why
_generated
isn't in the .gitignorethanks for reply
no problem


it generated nothing
the setup.mjs is formatter
i discarded it
its there actually

vercel doesn't see it, it seems
ohh
you need to push to github first..
@Topf git ignored that folder
i wonder why he chose to git ignore it
ok removing that line
its kind of weird to push generated files to remote tho
i'd think
like it can be done at deploy stage maybe?
wouldn't it overload git history?
but ok comitting it
its not that many files




Using Convex with Vercel | Convex Developer Hub
Host your frontend on Vercel and your backend on Convex
ok checking what it means
or this is prob off

I assume at this point, the tokens don't get passed
maybe
thats from docs


maybe i need env here
no, the environment variable gets set in the vercel environment

ok i set these
see step 4
CONVEX_DEPLOY_KEY
mm

p.s. the project runs locally
thats with deploy_key
well, I'd run npm build locally and resolve all the issues first
a strange @Topf doesn't have a
bulid
commandGitHub
GitHub - Topfi/BetterAuth-Convex-9ui-shadcn-CLI-: 🔐 A polished B...
🔐 A polished Better Auth + Convex setup with React 19 & Vite. Full auth flows (magic links, OTP, TOTP, social sign-in), strong security, styled UI, & realtime sync. Perfect for MVPs...
i started building on convex from his template as it looked great
ok checking what build cmd should be
prob smth with vite
ok lets see


npm run generate && vite build
i guess this should be it
npm run generate && npx vite build
ok this more accurate
yea ok locally it passes
smth off in vercel
checking docs
I do have this
I'd stop writing messages here, since technically your main issue is resolved 😅
should I make new thread?
my thread was about deploying to vercel
but it didn't deploy
all builds fail

I basically want to get local convex project deployed on vercel
I set the right envs I think
i wonder if i can get this
/vercel/.npm/_logs/2025-09-23T17_08_21_706Z-debug-0.log

in vercel
to see why build fails in vercel
oh interesting it generated smth new

going to push this
mby thats the issue
yea same issue

nope, just use the time taken to write messages here in debugging your issue
yea I am trying to understand the reason but vercel is not saying much
did AI write the code?
ok trying to open that log file
no its from this template https://github.com/Topfi/BetterAuth-Convex-9ui-shadcn-CLI-
GitHub
GitHub - Topfi/BetterAuth-Convex-9ui-shadcn-CLI-: 🔐 A polished B...
🔐 A polished Better Auth + Convex setup with React 19 & Vite. Full auth flows (magic links, OTP, TOTP, social sign-in), strong security, styled UI, & realtime sync. Perfect for MVPs...
+ few changes
but those changes shouldn't affect the build
its mostly changing landing page and avoiding redirect
locally it works and opens
its using latest react 19 but i assume convex works with 19
A patch update is available for Convex (1.27.1 → 1.27.3)
also going to up convexIn more than one screenshot, it shows
Missing script: "build"
Confirm that there's a build script defined in package.json
omg you are right
"build": "npm run generate && npx vite build",
ok added this and building
thank you
or actually
I guess build should be this
"build": "npx convex deploy --cmd 'npm run build'",
Yeah, that's what it should be
oo promising

it doom loops

i wonder why
oo

maybe this needs change
ok trying with this

ok cancelling this

I don't have much time, but let me check the one app I've got on Vercel. It's been so long since I deployed it that I forgot how it's configured.
In Vercel, I've got the override mentioned in the docs:
npx convex deploy --cmd 'npm run build'
In my project's package.json
, it has the build command for the framework I'm using (React Router), which is just react-router build
Sorry, but I don't have the time to dig into project files myself. I shouldn't even be in here, but something about the size of this thread intrigued me. 😂
Gotta get back to workoh wow

ok cancelled
maybe I need to install vercel adapter?
this is using react router
I remember with tanstack start for example, you would have
vercel()
adapter
although that was with vinxi
ok I found issue for infinite loopi used command from the docs

but it infinite loops with it
"build": "npx convex deploy",
trying with this now
"build": "vite build",
ok this actually, above is wrong too
I am not sure why happy path of vercel is not working tho

:magic_sparkles:

thanks everyone for the help, really appreciate it