에러가 발생하면 읽기 싫다...
귀찮다...
ERROR
Cannot read properties of null (reading 'style')
TypeError: Cannot read properties of null (reading 'style')
at toggleDropdown (http://localhost:3000/static/js/bundle.js:3149:12)
at HTMLUListElement.<anonymous> (http://localhost:3000/static/js/bundle.js:3163:9)
1. 에러 유형을 확인한다
TypeError: 잘못된 타입의 값을 사용하려고 한다
2. 에러 설명 확인
Cannot read properties of null (reading 'style')
3. 에러 발생 위치 확인
at toggleDropdown (http://localhost:3000/static/js/bundle.js:3149:12): 에러가 발생한 함수와 파일의 위치를 나타냅니다. 이 경우 toggleDropdown 함수의 3149번째 라인, 12번째 열에서 에러가 발생했습니다.
- 함수로 찾기: toggleDropdown으로 검색 후 에러 확인
- bundle.js의 경우 개발자 도구를 열어 bundle.js 파일에서 확인
*번들된 파일은 sources 탭 이동 후 ./static/js 에서 확인 가능
4. 추가 호출 스택 확인
at HTMLUListElement.<anonymous> (http://localhost:3000/static/js/bundle.js:3163:9):
이 부분은 toggleDropdown 함수가 호출된 위치를 나타냅니다. *이벤트 리스너가 익명 함수로 정의되어 있음
*함수 정의 부분이 아닌 호출된 위치임