Next build hangs for react + next application

Hello guys I’m facing issues trying to build/deploy my react application , the npm run build command is working ok on my local environment and is taking about 2 minutes all the execution but on Netlify it hangs, here the screenshot logs :

Here my netlify.toml file :

[build]
command = “npm run build”
publish = “frontend/.next”

[[plugins]]
package = “@netlify/plugin-nextjs”

My build command :
“scripts”: {
“build”: “next build”,
}

Env vars:

NPM_VERSION=7
NODE_VERSION=15
NODE_OPTIONS=–max_old_space_size=4096

Any advice or idea to debug this issue on netlify?

Thank you in advance ,

Hey there, :wave:

Welcome to the Netlify Forums :netliconfetti: Thanks for bringing this up! Sorry to hear you have encountered an obstacle.

I would suggest cross posting this on the essential next.js plugin repo. This way our next.js experts will see it a bit more quickly!

Please feel free to follow up here with a link to your issue once you do so, so that future Forums members can follow it should they encounter something similar.