
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
강의 학습중 firebase로 데이터베이스를 저장하는 과정에서 데이터가 정상적으로 서버에 전달되지 않는 문제를 겪었습니다.
firebase 도큐먼트를 확인해보니 addDoc 함수는 promise를 반환한다고 했는데 제 로컬 환경에서는 await문이 있음에도 작업이 처리되지 않습니다
이때 try catch문도 작동하지 않습니다
이때 inspect 에는 이런 오류가 발생합니다.
Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received

(강의 화면)
생략된 코드들은 정상적으로 작성되어있습니다 firebase 버전은 10.4.0 버전을 사용했습니다
const app = initializeApp(firebaseConfig);
const db = getFirestore(app);
console.log("firebase 초기화 완료");
$("#commentWrite").click(async function () {
console.log("클릭 이벤트 발생");
let doc = { name: "bob", age: 30 };
try {
// addDoc 함수가 Promise를 반환하는지 확인
const result = await addDoc(collection(db, "comment"), doc);
console.log("await 문 완료");
console.log("ID: ", result.id); // 성공 시 document ID 출력
} catch (error) {
console.error("Error: ", error); // 에러 처리
}
});
