Skip to content

Warn the user if their local build output is larger than 250MB#10439

Draft
falahat wants to merge 2 commits intomainfrom
local_builds_size_warning
Draft

Warn the user if their local build output is larger than 250MB#10439
falahat wants to merge 2 commits intomainfrom
local_builds_size_warning

Conversation

@falahat
Copy link
Copy Markdown
Contributor

@falahat falahat commented Apr 30, 2026

Description

Cloud Run only supports 250MB maximum size for zip deploys

Scenarios Tested

  • Put a big file in my nextjs app and ensure I see the warning
  • As a bonus, add that file to my ignore list (firebase.json) and make sure I do NOT get the warning

Sample Commands

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements a size limit check for local build artifacts in App Hosting, throwing a FirebaseError if the generated tarball exceeds the specified limit (defaulting to 250MB). Review feedback highlights that the implementation currently ignores the config.ignore field, which prevents users from excluding files to stay under the limit. Additionally, it is recommended to replace the magic number used for the size limit with a named constant to improve code maintainability.

Comment thread src/deploy/apphosting/util.ts
config: AppHostingSingle,
rootDir: string,
targetSubDir?: string,
sizeLimitBytes: number = 250 * 1024 * 1024,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The value 250 * 1024 * 1024 is a magic number representing the Cloud Run size limit. It should be defined as a named constant (e.g., CLOUD_RUN_SIZE_LIMIT_BYTES) at the top of the file to improve maintainability and clarity, especially since this limit is referenced in the error message logic as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants