Error! Command "vercel build" exited with 1

Viewed 710

I'm trying to upload to vercel but I get this error : "Error! Command "vercel build" exited with 1", another part of the error is "Error! No Output Directory named "public" found after the Build completed. You can configure the Output Directory in your Project Settings."

1 Answers

You have added a file to the page directory that vercel does not recognize with default export.

when i get that error i get this, example:

Build optimization failed: found page without a React Component as default export in pages/articulos/elements See https://nextjs.org/docs/messages/page-without-valid-component for more info. Error! Command "npm run build" exited with 1 Error: Command "vercel build" exited with 1

I solved it by deleting the element file, which generates the conflict called "elements"

I did push again and everything went well

Related