firebase-tools icon indicating copy to clipboard operation
firebase-tools copied to clipboard

apphosting emulator startCommand doesn't work with Angular

Open markgoho opened this issue 7 months ago • 3 comments

[REQUIRED] Environment info

firebase-tools: 14.0.1

Platform: Windows 11

[REQUIRED] Test case

I've got an angular application that I've successfully deployed to app hosting, but when I run the local emulator, there's no sign of it working.

[REQUIRED] Steps to reproduce

Initialized emulators and got this config:

    "apphosting": {
      "port": 5002,
      "rootDirectory": "./apps/<my-ssr-angular-app>"
    },

but when I run firebase emulators:start

I get

Error: Failed to auto-detect your project's start command. Consider manually setting the start command by setting `firebase.json#emulators.apphosting.startCommand`

There doesn't appear to be any documentation on what this startCommand should do. Build? Serve? (I've tried both and neither work)

There seems to also be a discrepancy between "autodetect start command" in emulators and what the apphosting deployment does which seems to be some magic of detecting the framework and building the application. Again, this worked without issue in the real deployment, I guess we're just missing some parity with how the emulators work.

[REQUIRED] Expected behavior

Initializing apphosting emulators should "just work" the same way remote apphosting "just works", OR better documentation should be provided on how local emulation of apphosting works so devs know what the startcommand should be and how it interacts with the apphosting.

[REQUIRED] Actual behavior

Nothing works, e.g. no startCommand provided (auto-detect), nx serve nx build

markgoho avatar Mar 29 '25 17:03 markgoho