개발자
index-30f3030e.js?7426:1267 Uncaught (in promise) TypeError: Cannot assign to read only property 'isRunning' of object '#<ProactiveRefresh>' at ProactiveRefresh._stop (index-30f3030e.js?7426:1267:1) at UserImpl._stopProactiveRefresh (index-30f3030e.js?7426:1681:1) at AuthImpl.directlySetCurrentUser (index-30f3030e.js?7426:2588:1) at eval (index-30f3030e.js?7426:2442:1) _stop @ index-30f3030e.js?7426:1267 _stopProactiveRefresh @ index-30f3030e.js?7426:1681 directlySetCurrentUser @ index-30f3030e.js?7426:2588 eval @ index-30f3030e.js?7426:2442 로그아웃 함수를 실행하면 위와 같은 에러가 나는데요. 로그아웃을 하고 싶은데, 로그아웃이 되질 않아서 useEffet로 로그인 상태를 감지하는 함수에서도 계속 로그인이 된 상태로 나옵니다 ㅜㅜ
답변 1
에러 메시지를 보면 ' Cannot assign to read only property ' 'isRunning' 오류가 발생하고 있습니다. 이 오류는 ' ProactiveRefresh ' 객체의 ' isRunning ' 속성이 읽기 전용(read-only)으로 설정되어 있기 때문에 값을 할당할 수 없다는 의미입니다. 이 문제는 Firebase SDK의 버그로 알려져 있으며 Firebase SDK 9.1.1 이상에서 수정되었습니다. 현재 사용 중인 Firebase SDK 버전이 9.1.1 이하인 경우 이 오류가 발생할 수 있습니다. 따라서 Firebase SDK를 최신 버전으로 업데이트하시거나, 아니면 로그아웃 함수에서 ' ProactiveRefresh ' 객체의 ' isRunning ' 속성을 직접 변경하거나 삭제하시면 됩니다. 아래는 ' isRunning ' 속성을 삭제하는 방법입니다. 아래 코드에서 ' delete firebaseAuth.currentUser.proactiveRefresh.isRunning; '부분을 추가하면 ' isRunning ' 속성을 삭제할 수 있습니다. 이후 로그아웃 함수를 실행하면 정상적으로 로그아웃이 됩니다.
1 2 3 4 5 6 7 8 9 10
const logOut = async () => { try { await firebaseAuth.signOut(); delete firebaseAuth.currentUser.proactiveRefresh.isRunning; setMenuFlag(true); location.reload(); } catch (err) { console.log(err); } };
커리어리 AI 봇의 답변을 평가해 주세요!
지금 가입하면 모든 질문의 답변을 볼 수 있어요!
현직자들의 명쾌한 답변을 얻을 수 있어요.
이미 회원이신가요?
지금 가입하면 모든 질문의 답변을 볼 수 있어요!