Astro v4 hybrid/ssr builds successfully but fails to deploy using adapter

astro: 4.5.6
@astrojs/netlify: 5.1.3 (adapter)

Using node v20.11.1 (npm v10.2.4)

import netlify from "@astrojs/netlify";
  adapter = netlify( {
    edgeMiddleware: false,
    imageCDN: false
  } );

adapter variable is added to astro config appropriately.

Deploy logs:

10:22:43 AM: Deploy site                                                   
10:22:43 AM: ────────────────────────────────────────────────────────────────
10:22:43 AM: ​
10:22:46 AM: Calculating files to upload
10:22:49 AM: 1 new files to upload
10:22:49 AM: 1 new functions to upload
10:22:56 AM: could not parse form file: http: request body too large
10:22:56 AM: Failed to upload file: ssr
10:22:56 AM: Section completed: deploying
10:22:56 AM: ​
10:22:56 AM: Error deploying                                               
10:22:56 AM: ────────────────────────────────────────────────────────────────
10:22:56 AM: ​
10:22:56 AM:   Error message
10:22:56 AM:   Deploy did not succeed with HTTP Error 400: [PUT /deploys/{deploy_id}/functions/{name}][400] uploadDeployFunction default  &{Code:400 Message:could not parse form file: http: request body too large}
10:22:56 AM: ​
10:22:56 AM:   Error location
10:22:56 AM:   At deploy the stage with HTTP status code "400"
10:22:56 AM: ​
10:22:56 AM:   Resolved config
10:22:56 AM:   build:
10:22:56 AM:     commandOrigin: ui
10:22:56 AM:     publishOrigin: ui
10:22:57 AM: Failed during stage "building site": Build script returned non-zero exit code: 2
10:22:57 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
10:22:57 AM: Failing build: Failed to build site

if any more information is needed, please message me directly as I would like to keep site information as anonymous as possible. Thanks.

Looks like the Function bundle is going over the 50 MB zipped or 250 MB unzipped limit. Are you bundling too many files or dependenices in your code?

I have literally one Astro endpoint to handle processing a contact form submission. The rest of the app should be static. So not sure how or why that’s happening.

It’s almost like it’s trying to bundle the entire application as a function or something. Very weird.

This application has no netlify “functions” defined.

For what it’s worth, the same Astro application deploys in hybrid rendering mode to Vercel using their adapter.

You can try building locally using the Netlify adapater and using Netlify CLI to explore the size of the function zip that you get. You can preferably choose to do this on an Ubuntu machine or a Netlify Docker image to get more accurate representation of the underlying system.

Installed Netlify CLI. Authenteicated and linked application. ran the build command. simply just outputted the contents of the Astro build command into the dist directory. Nothing zipped. Seeming nothing relevant to Netlify specifically.

if I dont have any functions, can I just specify a flag to say functions skip or disabled so the build doesnt have to worry about functions?

I updated astro and the netlify adapter

new versions

“astro”: “^4.5.6”, → “astro”: “^4.5.12”,
@astrojs/netlify”: “^5.1.3”, → “@astrojs/netlify”: “^5.2.0”,

now it’s deploying fine.

Not sure what was changed but it’s working now.