Failed to connect Firebase services after exiting Firebase Emulators

I’ve follow the instructions on Firebase Emulators Suite’s doc from https://firebase.google.com/docs/emulator-suite/install_and_configure. The Firebase Emulators works, e.g. Auth and Firestore. But when I exit emulators using Ctrl + C, and then try to add new data to Firestore. It doesn’t work. Hope someone can help!

import { initializeApp } from "firebase/app";
import { connectAuthEmulator, getAuth, GoogleAuthProvider } from "firebase/auth";
import {connectFirestoreEmulator, getFirestore} from 'firebase/firestore';

const firebaseConfig = {
  apiKey: import.meta.env.VITE_FIREBASE_API_KEY,
  authDomain: import.meta.env.VITE_FIREBASE_AUTH_DOMAIN,
  projectId: import.meta.env.VITE_FIREBASE_PROJECT_ID,
  storageBucket: import.meta.env.VITE_FIREBASE_STORAGE_BUCKET,
  messagingSenderId: import.meta.env.VITE_FIREBASE_MESSAGING_SENDER_ID,
  appId: import.meta.env.VITE_FIREBASE_APP_ID,
};

const app = initializeApp(firebaseConfig);
export const auth = getAuth(app);
export const db = getFirestore(app);
export const googleProvider = new GoogleAuthProvider()

connectAuthEmulator(auth,'http://localhost:9099');
connectFirestoreEmulator(db, 'localhost', 8080);

The error message in the console:

firebase_firestore.js?v=b5d4dfea:1775 
POST http://localhost:8080/google.firestore.v1.Firestore/Write/channel?VER=8&database=projects%2Fsalon-project-43926%2Fdatabases%2F(default)&RID=85555&CVER=22&X-HTTP-Session-Id=gsessionid&zx=rqw6jovafaan&t=1 net::ERR_CONNECTION_REFUSED

Have tried reopen the terminal