FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(hosting): route Cloud Run rewrites to local functions emulator by demolaf · Pull Request #10588 · firebase/firebase-tools · GitHub

fix(hosting): route Cloud Run rewrites to local functions emulator - #10588

Merged
demolaf merged 3 commits into
mainfrom
fix/cloud-run-proxy-emulator
Jun 11, 2026
Merged

fix(hosting): route Cloud Run rewrites to local functions emulator#10588
demolaf merged 3 commits into
mainfrom
fix/cloud-run-proxy-emulator

Conversation

demolaf commented Jun 2, 2026
edited
Loading

Copy link
Copy Markdown
Member

When using Firebase Hosting rewrites with "run" format (required for Dart/Cloud Run functions),
the hosting emulator always hit the live Cloud Run API to resolve the service URL — even when the
functions emulator was running locally. This caused an error like:

Error looking up URL for Cloud Run service: 404, Resource 'app' does not exist

Fix

Add emulator detection to cloudRunProxy.ts, mirroring the existing logic in functionsProxy.ts.
When targets includes "functions" and the functions emulator is running, route directly to the
local emulator URL instead of calling the Cloud Run API.

Related firebase/firebase-functions-dart#200

demolaf marked this pull request as draft June 2, 2026 22:17

gemini-code-assist Bot left a comment

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Code Review

This pull request adds support for routing Cloud Run rewrites to the local functions emulator when 'functions' is specified in the targets and the emulator is running. The review feedback suggests optimizing the implementation by replacing lodash dependencies (includes and cloneDeep) with native TypeScript features, such as optional chaining with Array.prototype.includes and standard object spreading, which allows for the removal of the external lodash imports.

Comment thread src/hosting/cloudRunProxy.ts Outdated
Comment thread src/hosting/cloudRunProxy.ts Outdated
Comment thread src/hosting/cloudRunProxy.spec.ts Outdated
Comment thread src/hosting/cloudRunProxy.spec.ts Outdated
Comment thread src/hosting/cloudRunProxy.spec.ts Outdated

shettyvarun268 left a comment

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM.
NIT: I think it would be a good idea to update the CHANGELOG.md for this PR as well.

demolaf force-pushed the fix/cloud-run-proxy-emulator branch from 1dff63b to 5af5077 Compare June 11, 2026 17:53
demolaf enabled auto-merge (squash) June 11, 2026 18:07
demolaf merged commit ecbaa4b into main Jun 11, 2026
51 checks passed
demolaf deleted the fix/cloud-run-proxy-emulator branch June 11, 2026 18:08
bkendall pushed a commit that referenced this pull request Jul 9, 2026
…10588)

* fix(hosting): route "run" rewrites to local functions emulator

* updates

* chore: update CHANGELOG
yuichi0301 pushed a commit to yuichi0301/firebase-tools that referenced this pull request Aug 16, 2026
…irebase#10588)

* fix(hosting): route "run" rewrites to local functions emulator

* updates

* chore: update CHANGELOG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

4 participants


Back | FazBrowse Home | New Git URL