26/02/24
1️⃣ MongoDB Atlas 연결 시 아래 에러 발생
2️⃣ 에러 화면
querySrv ECONNREFUSED _mongodb._tcp.mirujima-db.csfuczt.mongodb.net

체크 사항
DNS 레벨에서 SRV 조회 거부 문제?
3️⃣ 해결
app.js수정. Node에서 DNS 서버를 강제로 IPv4 기반 공용 DNS로 설정; 단순한 DB 연결 에러처럼 보였지만, 실제 원인은 OS 레벨 DNS 동작 방식 차이인듯
require("dotenv").config({ override: true });
const dns = require("dns");
dns.setDefaultResultOrder("ipv4first");
dns.setServers(["1.1.1.1", "8.8.8.8"]);
📎월 이동 시 API 미호출
1️⃣ 캘린더 월 이동 시 API 미호출
2️⃣ v-calendar는 월 이동 시 update:pages 이벤트를 발생시킴
3️⃣ 해결
부모(MainView)에서 해당 이벤트를 받아 summary API 호출
function onUpdatePages(pages) {
const first = pages[0];
const monthStr = toMonthStr(first.year, first.month);
emit("monthChange", monthStr);
}
📎캘린더 월 이동 시 API 무한호출
1️⃣ 첫 진입시 캘린더 무한 호출
2️⃣ 마지막으로 emit한 month를 저장
3️⃣ 해결
const lastEmittedMonth = ref("");
if (monthStr === lastEmittedMonth.value) return;
lastEmittedMonth.value = monthStr;
emit("monthChange", monthStr);