Skip to content

[Firefox] 다시 처음으로 클릭 시 'testfile is undefined' 에러 발생 #5

@Queue-ri

Description

@Queue-ri

문제 상황

파이어폭스에서 다시 처음으로 버튼 클릭시 테스트 데이터 로딩 에러가 발생함.

image

문제 발생 브라우저

  • Linux Firefox

관련 코드

<a href={window.location.href} className={styles.restart_btn_a}>
<button className={styles.restart_btn}>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fillRule="evenodd" clipRule="evenodd" d="M15.132 8.28631C14.8837 8.24314 14.6284 8.30021 14.4222 8.44497C14.2161 8.58972 14.0759 8.81032 14.0326 9.05823C13.786 10.473 13.0465 11.7552 11.9448 12.6782C10.8431 13.6013 9.45011 14.1058 8.01195 14.1026C4.64242 14.1026 1.90101 11.3653 1.90101 8C1.90101 4.6355 4.64242 1.89818 8.01195 1.89818C9.54384 1.89818 10.9846 2.46288 12.111 3.48315L11.3252 4.26773C11.2224 4.36998 11.1501 4.4987 11.1162 4.63957C11.0823 4.78045 11.0882 4.92795 11.1333 5.06567C11.1784 5.20338 11.2608 5.32591 11.3715 5.41962C11.4821 5.51333 11.6167 5.57454 11.7601 5.59645L15.0964 6.11053C15.2182 6.12929 15.3428 6.11909 15.46 6.08074C15.5772 6.0424 15.6837 5.977 15.7708 5.88985C15.8579 5.8027 15.9232 5.69627 15.9614 5.57919C15.9996 5.46211 16.0096 5.33768 15.9906 5.21602L15.4766 1.88552C15.4545 1.7424 15.3931 1.60819 15.2993 1.49778C15.2055 1.38736 15.0828 1.30506 14.945 1.26001C14.8072 1.21495 14.6595 1.2089 14.5185 1.24253C14.3774 1.27616 14.2484 1.34816 14.1459 1.45052L13.4552 2.14098C11.9789 0.762926 10.0328 -0.002538 8.01195 6.32249e-06C3.59449 6.32249e-06 0 3.58913 0 8C0 12.4117 3.59449 16 8.01195 16C11.9154 16 15.2342 13.2176 15.9051 9.38409C15.9483 9.13615 15.8912 8.88123 15.7462 8.67536C15.6012 8.4695 15.3803 8.32956 15.132 8.28631Z" fill="#2F2F2F"/>
</svg>
<p>다시 처음부터</p>
</button>
</a>

useLayoutEffect(() => {
init()
}, []);
function init() {
let testfile; // file selector
switch (id) {
case 1: testfile = test1_data; break;
case 2: testfile = test2_data; break;
case 3: testfile = test3_data; break;
case 4: testfile = test4_data; break;
case 5: testfile = test5_data; break;
case 6: testfile = test6_data; break;
case 7: testfile = test7_data; break;
case 8: testfile = test8_data; break;
case 9: testfile = test9_data; break;
case 10: testfile = test10_data; break;
case 11: testfile = test11_data; break;
case 12: testfile = test12_data; break;
case 13: testfile = test13_data; break;
case 14: testfile = test14_data; break;
case 15: testfile = test15_data; break;
case 16: testfile = test16_data; break;
case 17: testfile = test17_data; break;
}

확인이 필요한 사항

  • id가 undefined 인지
  • useLayoutEffect가 트리거되는지

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions