-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: Cannot exit cleanly #13
Comments
An interesting follow up. If I open another terminal and kill port 3000, the port my Vue dev server is running on, the process ends and the currently hanging terminal exits back to the command line with a npx kill-port 3000 |
I have been experimenting with this plugin locally and found that these changes seem to allow it to shut down correctly Remove the following line, we will manually do a clean shutdown later when we detect SIGTERM // shutdownWhenKilled({}) Remove the monkey patching on the // patch server.close to close emulators as well
// const { close: closeServer } = server
// server.close = async () => {
// await Promise.all([closeServer(), cleanShutdown()])
// } Finally, create a const shutdown = async () => {
await cleanShutdown()
await server.close()
// this prevents the process from hanging after server close
process.exit(0)
}
process.on('SIGINT', shutdown)
process.on('SIGTERM', shutdown) Now, when you hit Ctrl + C to stop the vite dev server, firebase shuts down cleanly and you're returned to the command prompt. |
I have a Vite + Vue 3 project. I installed this plugin to simplify the startup but have found that hitting Ctrl+C doesn't exit cleanly.
vite.config.ts
The project starts fine; I see Firebase emulator start without errors. However, when I hit Ctrl+C to exit, I get the normal emulator shut down messages, but I don't get returned to the command prompt; It just hangs. When I hit Ctrl+C again (where the
^C
are), it starts displaying emulator warnings. It still won't return to the command prompt, however.The only way I'm able to exit is by closing the terminal window. This leaves port 3000 open.
The text was updated successfully, but these errors were encountered: