firebase / firebase/firebase-tools
Close port if an error occurs during function parsing
- 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
Assessment
This issue has not been assessed yet.