Netlify not Building on Nextjs app. Build command failed

I am attempting to deploy a nextjs app on Netlify but it keeps failing when building the site. My netlify app is preeminent-kashata-cd6f78 but I am unable to deploy. I changed the build name on the site settings/build & deploy/ to “next build”, cleared the cache, and deployed again but it gave me the same error. I then tried to installed the netlify plugin on my project using
npm i @netlify/plugin-nextjs

I added a netlify.toml file on the root directory of my nextjs project and added the following in the file

command = “npm run build”
publish = “.next”

package = “@netlify/plugin-nextjs”

I changed the build name to npm run build and attempted to deploy again but I am getting the same error.

I appreciate any suggestions on how to fix this. These are my error messages.

Hi @EliLizR :wave:t6: ,

Welcome to the forums and thanks for reaching out. There a few things wrong with your build based on your recent failed log. Here are some tips that will hopefully be of use to use. Does this work for you locally? If not try getting it working on your local first. If it does work locally and fails to build here are some tips:

To address these issues, you can take the following steps:

  • Configure build caching to improve rebuild speed.
  • Replace <img> elements with <Image /> from next/image.
  • Add the missing dependencies to the useEffect hook in Payments.js or adjust the dependency array

I also STRONGLY encourage that you check out our debugging guide. Going off of the info you provided I can only make educated guesses. It would be helpful if you supplied your repo as well?

Thank you for the help! I was able to deploy it successfully after addressing a couple of the issues