firebase / firebase/firebase-tools

AppHosting startCommand & framework port limitation

Open
#9,884 0 comments 1 reaction 0 assignees View on GitHub
emulator: app hosting
Dominant language
TypeScript
Stars
4.5k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
84

Description

https://github.com/firebase/firebase-tools/blob/729dbcfca4a260543d30cb08781717c027a9c369/src/emulator/apphosting/serve.ts#L109-L123

We just upgraded from 14.10.x and the emulator stopped working.

The logic prevents that we use `--port` in the command, which is too restrictive, specially taking into account that the option is called `startCommand` and allows any arbitrary command.
Further on that logic, it adds the port only if the command contains `ng serve`, which is Angular only, and it makes no sense, since it can easily be a call to a custom script.

In my opinion, this isn't a good approach, unless you want to reduce flexibility, which in that case I wouldn't even provide a custom `startCommand` at all.

I recommend that either
- you remove this limitation and document the user should pass the port manually in the start command (as we were doing already in our team)
- or you pass an arbitrary `-- --port $port` no matter the command that is set up by the user and document that option too

This change was introduced in `14.17.0`, but I believe this should have been flagged as a breaking change. Unfortunately, nothing was warned or documented either.

Thank you.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.