Skip to content

Add --port to ng serve commands#9113

Merged
annajowang merged 5 commits intomasterfrom
emulator-angular
Sep 12, 2025
Merged

Add --port to ng serve commands#9113
annajowang merged 5 commits intomasterfrom
emulator-angular

Conversation

@annajowang
Copy link
Copy Markdown
Contributor

@annajowang annajowang commented Sep 11, 2025

Description

Add --port to ng serve custom commands because angular does not support nodejs.process.env.PORT. Without --port the ng CLI will use its own default port and the emulator will eventually time out when it finds nothing on the expected port.

As a result we are also throwing an error if any custom command has specified --port or -p as this will result in the same issue above.

A caveat is that if it's not a custom start command and the emulator executes npm run dev, the dev script may have --port but we won't be able to detect this. This will result in the same error above.

Scenarios Tested

custom start command is ng serve
the default npm run dev command is used for a nextjs app

@annajowang annajowang linked an issue Sep 11, 2025 that may be closed by this pull request
@annajowang annajowang marked this pull request as ready for review September 11, 2025 21:00
@annajowang annajowang enabled auto-merge (squash) September 12, 2025 20:42
@annajowang annajowang merged commit e175bb6 into master Sep 12, 2025
48 checks passed
@annajowang annajowang deleted the emulator-angular branch September 12, 2025 20:53
@github-project-automation github-project-automation bot moved this from Approved [PR] to Done in [Cloud] Extensions + Functions Sep 12, 2025
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.

apphosting emulator startCommand doesn't work with Angular

2 participants