Convex Auth in production
I’m deploying my Vite React app to Railway from a GitHub repo with Convex, and I’ve run into an issue. My build script works fine with:
"build": "tsc -b && vite build && npx convex deploy"
However, when I add Convex Auth initialization for production:
"build": "tsc -b && vite build && npx convex deploy && npx @convex-dev/auth --prod"
the deployment fails with the following error:
! No source control detected. We strongly recommend committing the current state of your code before proceeding.
...
ERROR: failed to solve: process "/bin/bash -ol pipefail -c tsc -b && npx convex deploy && vite build && npx @convex-dev/auth --prod" did not complete successfully: exit code: 130
My current scripts:
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build && npx convex deploy && npx @convex-dev/auth --prod",
"lint": "eslint .",
"preview": "vite preview"
}
Is this the right way to initialize Convex Auth during production deployment? If not, what would be the recommended approach to ensure the @convex-dev/auth setup runs correctly for production?
Thanks in advance for your help!
