Skip to content

Convex deploy problem on nextjs apps #103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
devLeopar opened this issue May 22, 2025 · 3 comments · May be fixed by #104
Open

Convex deploy problem on nextjs apps #103

devLeopar opened this issue May 22, 2025 · 3 comments · May be fixed by #104

Comments

@devLeopar
Copy link

Hi;
There seems a bug happening on while deploying convex on either locally or when trying to deploy on vercel.
The documentation suggest using custom build command which is
npx convex deploy --cmd 'npm run build'

However, this command fails generating convex/_generated folder before nextjs try to build whole app. Therefore, it results in 'module not found' errors on the files that imports modules from this folder.

I found a solution. If we ignore --cmd option and update the custom build command like below:
npx convex deploy && npm run build
It waits convex to deploy and generate related folder and files, then run next build.

My suggestion is updating documentation which is here: https://docs.convex.dev/production/hosting/vercel

@nipunn1313
Copy link
Collaborator

Can you provide repro steps? Like what is an example app (ideally one of the Convex demo apps) and add screenshots / exact information from the errors you are seeing.

Thanks for the reprot.

@devLeopar
Copy link
Author

@nipunn1313 I've created a PR for this and explained a bit more

@wkd-kapsule
Copy link

The issue is probably the docs saying npm convex deploy --cmd 'npm run build' but you can see in the screenshot that it actually is npm convex deploy --cmd='npm run build' with = after --cmd. I guess this is the issue because I'm using = for my project and have no issue deploying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants