홈>
아래와 같은 생성자가 있습니다 :
constructor(props) {
super(props)
this.state = {
ipfsHash: '',
web3: null,
buffer: null,
account: null
};
this.captureFile = this.captureFile.bind(this);
this.onSubmit = this.onSubmit.bind(this);
}
그럼 :
this.simpleStorageInstance.set(result[0].hash, { from: this.state.account}).then((r) => {
return this.setState({ipfsHash: result[0].hash })
console.log('ipfsHash', this.state.ipfsHash)
})
콘솔 읽기 :
Uncaught TypeError: Cannot read property 'set' of undefined.
내가 뭘 잘못하고 있니?
- 답변 # 1
관련 자료
- javascript - 44 uncaught typeerror : cannot read property 'type'of undefined;at getanswer ((index) : 44);at htmlbuttonelementonc
- javascript - leaflet uncaught typeerror - undefined의 'length'속성을 읽을 수 없으며 markerclusters가 정의되지 않았습니다
- javascript - "uncaught (in promise) typeerror - cannot read property 'appendchild'of null" 내 코드 에서이 오류가 발생했습니다
- javascript - 잡히지 않은 typeerror - js 파일에서 정의되지 않은 오류의 'addeventlistener'속성을 읽을 수 없습니다
- html - 잡히지 않은 typeerror - null의 'style'속성을 읽을 수 없습니다 동일한 페이지에서 두 개의 javascript 함수 사용
- javascript - 포착되지 않은 typeerror - 정의되지 않은 'fontfamily'속성을 설정할 수 없습니다
- jquery - 잡히지 않은 typeerror - 스팬 텍스트가 비어있는 경우 정의되지 않은 'innerhtml'속성을 읽을 수 없습니다
- jqueryminjs - 2 uncaught typeerror : cannot read property 'replace'of undefined (javascript) (laravel)
- node.js - 이 오류가 발생하는 이유 typeerror - cannot read property 'utf8slice'of undefined
- reactjs - typeerror - 정의되지 않은 'temp'속성을 읽을 수 없습니다
- javascript - typeerror - 정의되지 않은 '필터'속성을 읽을 수 없습니다개체 데이터
- reactjs - typeerror - null의 'getstate'속성을 읽을 수 없습니다
- javascript - typeerror - reactjs에서 정의되지 않은 'map'속성을 읽을 수 없습니다
- javascript - typeerror - react에서 undefined의 'state name in many object'속성을 읽을 수 없습니다
- node.js - connect-mongodb-session - typeerror : 정의되지 않은 속성 'store'를 읽을 수 없습니다 (mongodb, nodejs, connect-mongodb-session)
- angular8 - angular 8 - typeerror : 프로덕션 용 코드를 빌드 할 때 정의되지 않은 '종류'속성을 읽을 수 없습니다
- javascript - [vue 경고] - 렌더링 오류 : "typeerror : 정의되지 않은 'correct_answer'속성을 읽을 수 없습니다"
- javascript - 반응 - typeerror : 정의되지 않은 속성 'props'를 설정할 수 없습니다
- node.js - 오류 유형 오류 - 정의되지 않은 'style-resources-loader'속성을 읽을 수 없습니다
- [karma server] TypeError Cannot read property 'range' of undefined - [karma-server] - typeerror : 정의되지 않은 '범위'
트렌드
- OpenCv의 폴더에서 여러 이미지 읽기 (python)
- 파이썬 셀레늄 모든 "href"속성 가져 오기
- html - 자바 스크립트 - 클릭 후 변경 버튼 텍스트 변경
- git commit - 자식 - 로컬 커밋 된 파일에 대한 변경을 취소하는 방법
- JSP에 대한 클래스를 컴파일 할 수 없습니다
- javascript - 현재 URL에서 특정 div 만 새로 고침/새로 고침
- jquery - JavaScript로 현재 세션 값을 얻으시겠습니까?
- javascript - swiperjs에서 정지, 재생 버튼 추가
- python - 문자열에서 특정 문자 제거
- JavaScript 변수를 HTML div에 '출력'하는 방법
유일한
set
를 고려 코드에서 호출은this.simpleStorageInstance
에서 발생합니다 그리고this.simpleStorageInstance
에 할당 생성자의 코드에서 찾을 수 없습니다.이 속성 값을 올바르게 설정하는 것을 잊었습니다.