v0.1.66
v0.1.66 — 핫픽스: Cannot access 'hasAgent' before initialization TDZ 오류 수정
사용자 보고
- "프로그램 구동시 오류 — Cannot access 'hasAgent' before initialization" (v0.1.63~v0.1.65 모두 영향)
원인
- v0.1.63 에서 추가한 sub-sidebar auto-follow useEffect 가
[..., hasAgent, last?.path, openSubSidebar]를 deps 배열에 넣었는데,hasAgent는 그 useEffect 보다 아래에서const hasAgent = !!(followedAgent && last)로 선언됨. useEffect 호출 시점 (synchronous, render-time) 에 deps 배열의hasAgentreference 가 TDZ (Temporal Dead Zone) 위반 → 즉시 ReferenceError 발생.
수정
src/components/Avatars/AgentFollowPanel.tsx—const hasAgent = !!(followedAgent && last)선언을last계산 직후 (early return 위) 로 이동. 모든 hook 의 deps 배열이 hasAgent 를 안전하게 참조 가능.- 기존 위치 (early return 아래) 의 선언은 주석으로 대체.
영향
- v0.1.63 / v0.1.64 / v0.1.65 모두 영향 받음 — v0.1.66 부터 정상 동작.
검증
npx tsc --noEmitexit=0.npm run build통과.
📦 GitHub 릴리스 노트: v0.1.66