Hello,
I had a build error regarding maximum size of 250 MB.
So I created output: ‘standalone’ folder (45mb) and set root directory : client.next\standalone
But that caused a different error The specified Root Directory “client.next\standalone” does not exist.
On my local machine, I see folder \client.next\standalone )
Do I need to add a build step to vercel.json ?
Can I view the build artifacts ?
The error “The specified Root Directory “client.next\standalone” does not exist” occurs because the client.next\standalone directory is created during the build process, but Vercel is looking for it before the build starts .
Instead of changing the root directory, you should keep your original root directory (likely client or the directory containing your Next.js app) and use the outputDirectory setting in your vercel.json file . Here’s how:
{
"outputDirectory": "client/.next/standalone"
}
This tells Vercel where to find your build output after the build process is complete.
Also, ensure your build command in Vercel project settings is correct. It should be something like npx convex deploy --cmd 'npm run build' if you need to deploy Convex before building your Next.js app.
To view build artifacts, after a deployment, go to your project in the Vercel dashboard, click on the deployment, and check the “Source” tab .
Thank you for sharing your vercel.json configuration. I see you’re trying to use the Next.js standalone output while also incorporating a Python server. There are a few adjustments we can make to your configuration to get it working correctly:
Keep the outputDirectory as you have it.
Add a builds section to handle both Next.js and Python:
If I’m understanding correctly, this setup will build both your Next.js app and Python server, and route requests appropriately between them. Make sure your project structure matches these paths, and that your next.config.js has output: 'standalone' set.
This is a great tip!
(This is my first Next js app - alot of learning )
I got a different error : Error: Specified “src” for “@vercel/next” has to be “package.json” or “next.config.js”
I’ll make that change, and play around with it.
Thanks again, Peter