How to deploy codegen project on cloudflare pages

I’m able to deploy my static site nextjs on vercel with a click of a button, but when i try to integrate the github commit on cloudflare pages and then push the build, it always shows me this:

Failed: error occurred while running build command

Any idea how to deploy a codegen-nextjs to cloudflare pages, thanks