Skip to content

Emulator doesn't correctly handle hosting rewrites. #175

@schultek

Description

@schultek

Related issues

[REQUIRED] Version info

Dart SDK:

Dart SDK version: 3.11.0 (stable) (Mon Feb 9 00:38:07 2026 -0800) on "macos_arm64"

firebase_functions (Dart package):

0.6.0

firebase-tools (CLI):

15.14.1-main.0

[REQUIRED] Test case

Define a single function "echo" that just returns the request url.

Set up hosting rewrites in firebase.json to rewrite all requests to the function like this:

"hosting": {
      "rewrites": [
          {
              "source": "**",
              "function": "echo"
          }
      ]
  },

[REQUIRED] Steps to reproduce

  • Start the emulators
  • Request / (e.g. open in browser)
  • Request /other

[REQUIRED] Expected behavior

The function is called with the correct url path.

[REQUIRED] Actual behavior

This works without issues in production, but with the emulator has two issues:

  • When requesting /, the request url inside the function's handler is the function id /echo, not `/``
  • When requesting /other, the request fails with Function not found: other. Available functions: echo

Were you able to successfully deploy your functions?

Yes

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions