Javascript/error

typeerror: cannot read properties of null (reading 'useref')

PSummer._. 2023. 2. 15. 06:20

TypeError: Cannot read properties of null (reading 'useRef') 에러가 뜬다면!

package.json 파일을 확인해보자.

내가 import 해서 쓰려던, bootstrap reactbootstrap이 맞는 폴더에 install이 안 되었나보다.

그래서 npm i bootstrap react-bootstrap을 해주니까 해결되었다.

 

그러고 나니까, 또 에러가 뜨질 않나....! 이번엔 'useContext' 관련

TypeError: Cannot read properties of null (reading 'useContext')

그렇다면 이것도, import를 잘못했을 가능성이 높다고 판단했기 때문에 금방 해결할 수 있었다.

이번엔 npm i swr을 하니까 해결되었다.

 

어제 저녁에 하루종일 해도 안풀리던데,

역시 코딩을 하다가 안되면 붙잡고 있는 것보다 refresh한 뒤 다시 하면 해결될 때가 더 많은 것 같다.

 

When you guys are having same difficulty same as me,

please check 'package.json'.

To solve this problem, type 'npm i bootstrap react-bootstrap' in the terminal after going to the "right" folder.

'Javascript > error' 카테고리의 다른 글

error인건가?(JavaFX)  (2) 2023.02.27