#Can't run `npx convex dev` in a nextjs app

9 messages · Page 1 of 1 (latest)

main gulch
#

Hi! I'm trying to add convex to an existing NextJS app hosted on vercel, following this guide: https://docs.convex.dev/quickstart/nextjs

I pnpm installed convex locally, but when I run npx convex dev I get this error:

✖ Vercel build environment detected but CONVEX_DEPLOY_KEY is not set. Set this environment variable to deploy from this environment. See https://docs.convex.dev/production/hosting

I tried setting a CONVEX_DEPLOY_KEY in my production env var on vercel, but the error is local and I don't think I'm supposed to add a CONVEX_DEPLOY_KEY locally?

limpid mothBOT
#

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](https://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!
unique yoke
#

hmm. yeah, I wonder why it's detecting a "Vercel build environment"

#

is VERCEL defined in the environment for some reason on your machine?

main gulch
#

looks like yes.

I think I did a vercel env pull at some point in the past and it added these:

VERCEL="1"
VERCEL_ENV="development"
VERCEL_GIT_COMMIT_AUTHOR_LOGIN=""
VERCEL_GIT_COMMIT_AUTHOR_NAME=""
VERCEL_GIT_COMMIT_MESSAGE=""
VERCEL_GIT_COMMIT_REF=""
VERCEL_GIT_COMMIT_SHA=""
VERCEL_GIT_PREVIOUS_SHA=""
VERCEL_GIT_PROVIDER=""
VERCEL_GIT_PULL_REQUEST_ID=""
VERCEL_GIT_REPO_ID=""
VERCEL_GIT_REPO_OWNER=""
VERCEL_GIT_REPO_SLUG=""
VERCEL_URL=""
unique yoke
#

got it

#

yeah, that VERCEL=1 is making our lib think this is building in vercel's infra

main gulch
#

ok yeah, If I delete VERCEL="1", it works