firebase / firebase/firebase-tools

Close port if an error occurs during function parsing

Open
#4,293 0 comments 1 reaction 1 assignee Claimed by @joehan View on GitHub
type: bug
Dominant language
TypeScript
Stars
4.5k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
84

Description

### [REQUIRED] Environment info

**firebase-tools:** 10.2.2

**Platform:** macOS

### [REQUIRED] Test case

Create a fresh function using `firebase init functions`.

### [REQUIRED] Steps to reproduce

Run `firebase emulators:start` then make half changes to `functions/index.js` and save them.

### [REQUIRED] Expected behavior

The error handler would be triggered causing the emulator to stop and the ports to be released.

### [REQUIRED] Actual behavior

The error handler was triggered causing the emulator to stop but the ports weren't released and I had to kill them using
`npx kill-port 8085 8080 9099 5001`.

```
⚠ firestore: Port 8080 is not open on localhost, could not start Firestore Emulator.
⚠ firestore: To select a different host/port, specify that host/port in a firebase.json config file:
{
// ...
"emulators": {
"firestore": {
"host": "HOST",
"port": "PORT"
}
}
}
i emulators: Shutting down emulators.
Error: Could not start Firestore Emulator, port taken.
```

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.