Failed to deploy site

I have problem when try to build preview.

Site ID: 3989e53a-b653-43ff-843d-d98de0c7c5ca
Reference deploy URL: Netlify

I got this message. Could you check why ?

And why it is not happening with main branch deployment ?

5:16:37 PM: Starting to deploy site from '.next'
5:16:38 PM: Calculating files to upload
5:16:40 PM: 1 new file(s) to upload
5:16:40 PM: 14 new function(s) to upload
5:16:55 PM: The function exceeds the maximum size of 250 MB
5:16:55 PM: Failed to upload file: ___netlify-server-handler
5:16:55 PM: Section completed: deploying
5:16:55 PM: (node:7207) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 unpipe listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit
5:16:55 PM: (Use `node --trace-warnings ...` to show where the warning was created)
5:16:55 PM: (node:7207) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit
5:16:55 PM: (node:7207) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit
5:16:55 PM: (node:7207) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 finish listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit
5:16:55 PM: (node:7207) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 unpipe listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit
5:16:55 PM: (node:7207) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit
5:16:55 PM: (node:7207) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit
5:16:55 PM: (node:7207) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 finish listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit
5:16:56 PM: ​
5:16:56 PM: Error deploying                                               
5:16:56 PM: ────────────────────────────────────────────────────────────────
5:16:56 PM: ​
5:16:56 PM:   Error message
5:16:56 PM:   Deploy did not succeed with HTTP Error 400: [PUT /deploys/{deploy_id}/functions/{name}][400] uploadDeployFunction default  &{Code:400 Message:The function exceeds the maximum size of 250 MB}
5:16:56 PM: ​
5:16:56 PM:   Error location
5:16:56 PM:   At deploy the stage with HTTP status code '400'

Could you try to re-deploy your site now?

We’re also getting this error on our Next.js builds.

Using Netlify Next.js Runtime v5.9.4 and Next.js version 15.1.3

12:05:40 PM: Deploy did not succeed with HTTP Error 400: [PUT /deploys/{deploy_id}/functions/{name}][400] uploadDeployFunction default  &{Code:400 Message:The function exceeds the maximum size of 250 MB}

Failed deploy: Netlify

Hi @Dan9393993, thanks for the post.

12:05:40 PM: Deploy did not succeed with HTTP Error 400: [PUT /deploys/{deploy_id}/functions/{name}][400] uploadDeployFunction default  &{Code:400 Message:The function exceeds the maximum size of 250 MB}

As you can see from the build log, your function size exceeds the maximum size of 250 MB.
Kindly check your functions code or directory to ensure you are not uploading large files.