본문 바로가기

error23

[React] Uncaught (in promise) TypeError: Cannot read property 'push' of undefined 리액트 작업 중 로그인 후 페이지 대시보드로 넘기는 기능을 개발하는 중에 발생한 에러이다. 간단하게 props.history.push('/') 만으로 페이지가 넘어갈 줄 알았는데, 전혀 기능을 하지 않았다. 이를 해결하기 위해서는 react-router-dom 의 withRouter를 import하고, export 시 withRouter로 감싸주어야 한다. import { withRouter } from 'react-router-dom' ... export default withRouter(SamplePage) 2021. 5. 3.
[React] TypeError Cannot read property 'setState' of undefined 에러 리액트 작업 중 this.setState 함수로 상태를 변경하고자 할 때 발생하였다. 발생한 원인은 호출하는 함수를 bind 하지 않았기 때문이었다. 해결 방법은 두 가지이다. 1. Constructor에 함수 바인딩 this.onChange = this.onChange.bind(this) 2. Arrow function으로 구현 onChange = () => {} 2021. 5. 3.
[Spring] javax/xml/bind/DatatypeConverter 에러 스프링 시큐리티를 적용하는 과정에서 jwt 토큰 생성 중 발생한 에러이다 해당 문제는 jdk11 에서는 관련 모듈이 기본 참조되지 않아 에러가 발생한다고 한다. // https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1' // https://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-core implementation group: 'com.sun.xml.bind', name: 'jaxb-core', version: '2.3.0.1' // https://mvnrepository.c.. 2021. 4. 15.
port 8080 already in use 에러 스프링, 리액트 등을 재실행할 때 발생한 에러이다. 8080포트가 이미 실행중이라 이를 제거해야 한다. // 윈도우 netstat -ano | findstr 8080 // 리눅스 netstat -ano | grep 8080 명령으로 8080 포트가 실행중임을 확인하고, pid를 확인한다. taskkill /pid pid번호 /f 또는 kill [pid 번호] 명령으로 해당 pid를 삭제한다. 이후 다시 실행하면 정상 작동함을 확인할 수 있다. netstat 명령으로 검색 시 pid 번호가 나타나지 않는다면 lsof 명령을 사용해 확인할 수 있다. lsof -i:8080 만약 lsof not found 에러가 발생할 경우 lsof를 설치해준다 centOS sudo yum install lsof Ubuntu.. 2021. 4. 7.
[Spring] ./gradlew: command not found 에러 스프링 부트 코드를 서버에 옮겨서 grdlew로 빌드하는 상황에 발생한 에러이다. 이 에러는 gradlew에 실행권한이 없어 발생한 에러로, chmod +x gradlew 명령으로 실행권한을 부여하면 된다. * ./gradlew build 2021. 4. 7.
[Docker] containerd.io depends libseccomp2 ( = 2.4.1) but 2.3.3-4 is to be installed 에러 aws lightsail에서 도커 설치를 시도하다 발생한 에러이다. Debian 서버에 Ubuntu를 잘못 설치한 것이 원인으로, nano /etc/apt/sources.list 명령어를 치고, sources.list 파일을 편집한다. ubuntu로 설치된 항목들이 있을텐데, 이를 모두 지우고 sudo apt-get update 업데이트를 한 후 에러가 발생한 이미지를 다시 설치하면 에러 없이 설치가 완료될 것이다 2021. 3. 31.