Deployments failing using NextJS and next-on-pages

Hi,

We have been deploying our nextjs application for quite some time, and we have been seeing several errors on building that we cannot really diagnose:

one is:

20:47:28.559    ▲  Detected Next.js version: 14.0.1
20:47:28.562    ▲  Running "yarn run build"
20:47:29.984    ▲  Attention: Next.js now collects completely anonymous telemetry regarding usage.
20:47:29.985    ▲  This information is used to shape Next.js' roadmap and prioritize features.
20:47:29.985    ▲  You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
20:47:29.985    ▲  https://nextjs.org/telemetry
20:47:30.112    ▲  ▲ Next.js 14.0.1
20:47:30.113    ▲  - Experiments (use at your own risk):
20:47:30.113    ▲    · webpackBuildWorker
20:47:30.113    ▲  
20:47:30.114    ▲  Creating an optimized production build ...
20:48:13.428    ▲  Error: Command "yarn run build" exited with 129
20:48:13.467    
20:48:13.467    ⚡️ The Vercel build (`npx vercel build`) command failed. For more details see the Vercel logs above.
20:48:13.467    ⚡️ If you need help solving the issue, refer to the Vercel or Next.js documentation or their repositories.
20:48:13.467    
20:48:13.502    Failed: Error while executing user command. Exited with error code: 1
20:48:13.511    Failed: build command exited with code: 1
20:48:15.475    Failed: error occurred while running build command


And other occurrences are out of heap memory limit (and we tried with the NODE_OPTIONS --max-old-space-size of 8192 (even when the console says it only accepts 7GB of mem).

We can build in local, with no issues (yes, we have good hardware...).

Is there a way to at least output some more information in the logs?

Thanks, team!
Was this page helpful?