nikiv.dev
nikiv.dev2mo ago

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
No description
No description
82 Replies
nikiv.dev
nikiv.devOP2mo ago
https://github.com/genxai/new my project is open source here
Sara
Sara2mo ago
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 example
nikiv.dev
nikiv.devOP2mo ago
so do I run this locally npx convex dev then commit the generated files?
nikiv.dev
nikiv.devOP2mo ago
No description
nikiv.dev
nikiv.devOP2mo ago
mby it should be done at build phase? somewhere here perhaps
jamwt
jamwt2mo ago
yep, commit the generated files when you commit whatever code uses it
nikiv.dev
nikiv.devOP2mo ago
ok lovely, comitting
jamwt
jamwt2mo ago
that's why _generated isn't in the .gitignore
nikiv.dev
nikiv.devOP2mo ago
thanks for reply
jamwt
jamwt2mo ago
no problem
nikiv.dev
nikiv.devOP2mo ago
No description
nikiv.dev
nikiv.devOP2mo ago
No description
nikiv.dev
nikiv.devOP2mo ago
it generated nothing the setup.mjs is formatter i discarded it
nikiv.dev
nikiv.devOP2mo ago
its there actually
No description
nikiv.dev
nikiv.devOP2mo ago
vercel doesn't see it, it seems ohh
Sara
Sara2mo ago
you need to push to github first..
nikiv.dev
nikiv.devOP2mo ago
@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
nikiv.dev
nikiv.devOP2mo ago
its not that many files
No description
nikiv.dev
nikiv.devOP2mo ago
No description
nikiv.dev
nikiv.devOP2mo ago
No description
nikiv.dev
nikiv.devOP2mo ago
No description
nikiv.dev
nikiv.devOP2mo ago
ok checking what it means
nikiv.dev
nikiv.devOP2mo ago
or this is prob off
No description
nikiv.dev
nikiv.devOP2mo ago
I assume at this point, the tokens don't get passed maybe thats from docs
nikiv.dev
nikiv.devOP2mo ago
No description
nikiv.dev
nikiv.devOP2mo ago
No description
nikiv.dev
nikiv.devOP2mo ago
maybe i need env here
jamwt
jamwt2mo ago
no, the environment variable gets set in the vercel environment
nikiv.dev
nikiv.devOP2mo ago
No description
nikiv.dev
nikiv.devOP2mo ago
ok i set these
jamwt
jamwt2mo ago
see step 4 CONVEX_DEPLOY_KEY
nikiv.dev
nikiv.devOP2mo ago
mm
No description
nikiv.dev
nikiv.devOP2mo ago
p.s. the project runs locally thats with deploy_key
Sara
Sara2mo ago
well, I'd run npm build locally and resolve all the issues first
nikiv.dev
nikiv.devOP2mo ago
a strange @Topf doesn't have a bulid command
nikiv.dev
nikiv.devOP2mo ago
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...
nikiv.dev
nikiv.devOP2mo ago
i started building on convex from his template as it looked great ok checking what build cmd should be prob smth with vite
nikiv.dev
nikiv.devOP2mo ago
ok lets see
No description
nikiv.dev
nikiv.devOP2mo ago
No description
nikiv.dev
nikiv.devOP2mo ago
npm run generate && vite build i guess this should be it npm run generate && npx vite build ok this more accurate
nikiv.dev
nikiv.devOP2mo ago
No description
nikiv.dev
nikiv.devOP2mo ago
yea ok locally it passes smth off in vercel checking docs I do have this
Sara
Sara2mo ago
I'd stop writing messages here, since technically your main issue is resolved 😅
nikiv.dev
nikiv.devOP2mo ago
should I make new thread? my thread was about deploying to vercel but it didn't deploy all builds fail
nikiv.dev
nikiv.devOP2mo ago
No description
nikiv.dev
nikiv.devOP2mo ago
I basically want to get local convex project deployed on vercel I set the right envs I think
nikiv.dev
nikiv.devOP2mo ago
i wonder if i can get this /vercel/.npm/_logs/2025-09-23T17_08_21_706Z-debug-0.log
No description
nikiv.dev
nikiv.devOP2mo ago
in vercel to see why build fails in vercel
nikiv.dev
nikiv.devOP2mo ago
oh interesting it generated smth new
No description
nikiv.dev
nikiv.devOP2mo ago
going to push this mby thats the issue
nikiv.dev
nikiv.devOP2mo ago
yea same issue
No description
Sara
Sara2mo ago
nope, just use the time taken to write messages here in debugging your issue
nikiv.dev
nikiv.devOP2mo ago
yea I am trying to understand the reason but vercel is not saying much
Sara
Sara2mo ago
did AI write the code?
nikiv.dev
nikiv.devOP2mo ago
ok trying to open that log file
nikiv.dev
nikiv.devOP2mo ago
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...
nikiv.dev
nikiv.devOP2mo ago
+ 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 convex
Clever Tagline
Clever Tagline2mo ago
In more than one screenshot, it shows Missing script: "build" Confirm that there's a build script defined in package.json
nikiv.dev
nikiv.devOP2mo ago
omg you are right "build": "npm run generate && npx vite build", ok added this and building thank you or actually
nikiv.dev
nikiv.devOP2mo ago
No description
nikiv.dev
nikiv.devOP2mo ago
I guess build should be this "build": "npx convex deploy --cmd 'npm run build'",
Clever Tagline
Clever Tagline2mo ago
Yeah, that's what it should be
nikiv.dev
nikiv.devOP2mo ago
oo promising
No description
nikiv.dev
nikiv.devOP2mo ago
it doom loops
nikiv.dev
nikiv.devOP2mo ago
No description
nikiv.dev
nikiv.devOP2mo ago
i wonder why oo
nikiv.dev
nikiv.devOP2mo ago
No description
nikiv.dev
nikiv.devOP2mo ago
maybe this needs change ok trying with this
nikiv.dev
nikiv.devOP2mo ago
No description
nikiv.dev
nikiv.devOP2mo ago
ok cancelling this
No description
Clever Tagline
Clever Tagline2mo ago
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.
nikiv.dev
nikiv.devOP2mo ago
thank you https://github.com/genxai/new I pushed latest changes here
Clever Tagline
Clever Tagline2mo ago
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 work
nikiv.dev
nikiv.devOP2mo ago
oh wow
No description
nikiv.dev
nikiv.devOP2mo ago
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
import { defaultClientConditions, defineConfig } from "vite"
import react from "@vitejs/plugin-react"
import tailwindcss from "@tailwindcss/vite"
import path from "path"

export default defineConfig({
plugins: [
react({
babel: {
plugins: [
["babel-plugin-react-compiler", { compilationMode: "infer" }],
],
},
}),
tailwindcss(),
],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
conditions: ["@convex-dev/component-source", ...defaultClientConditions],
dedupe: ["react", "react-dom"],
},
test: {
environment: "jsdom",
},
})
import { defaultClientConditions, defineConfig } from "vite"
import react from "@vitejs/plugin-react"
import tailwindcss from "@tailwindcss/vite"
import path from "path"

export default defineConfig({
plugins: [
react({
babel: {
plugins: [
["babel-plugin-react-compiler", { compilationMode: "infer" }],
],
},
}),
tailwindcss(),
],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
conditions: ["@convex-dev/component-source", ...defaultClientConditions],
dedupe: ["react", "react-dom"],
},
test: {
environment: "jsdom",
},
})
although that was with vinxi ok I found issue for infinite loop
nikiv.dev
nikiv.devOP2mo ago
i used command from the docs
No description
nikiv.dev
nikiv.devOP2mo ago
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
nikiv.dev
nikiv.devOP2mo ago
No description
No description
nikiv.dev
nikiv.devOP2mo ago
wild ok i think SITE_URL needs to be in convex dash too https://dev.gen.new yayy
nikiv.dev
nikiv.devOP2mo ago
:magic_sparkles:
No description
nikiv.dev
nikiv.devOP2mo ago
thanks everyone for the help, really appreciate it

Did you find this page helpful?